You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/components/ghcide.md
+7-28Lines changed: 7 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,8 @@ Our vision is that you should build an IDE by combining:
8
8
9
9
*[`hie-bios`](https://github.com/mpickering/hie-bios) for determining where your files are, what are their dependencies, what extensions are enabled and so on;
10
10
*`ghcide` (i.e. this library) for defining how to type check, when to type check, and producing diagnostic messages;
11
-
* A bunch of plugins that haven't yet been written, e.g. [`hie-hlint`](https://github.com/ndmitchell/hlint) and [`hie-ormolu`](https://github.com/tweag/ormolu), to choose which features you want;
12
-
*[`haskell-lsp`](https://github.com/alanz/haskell-lsp) for sending those messages to a [Language Server Protocol (LSP)](https://microsoft.github.io/language-server-protocol/) server;
11
+
* A bunch of plugins that that implement optional features, such as formatting, eval, linter (via `hlint`), etc...
12
+
*[`haskell-lsp`](https://github.com/haskell/lsp) for sending those messages to a [Language Server Protocol (LSP)](https://microsoft.github.io/language-server-protocol/) server;
13
13
* An LSP client for your editor.
14
14
15
15
There are more details about our approach [in this blog post](https://4ta.uk/p/shaking-up-the-ide).
@@ -25,43 +25,26 @@ Until tools like cabal and stack provide the right interface to support multi-co
25
25
projects, it is always advised to specify explicitly how your project partitions.
26
26
2. Cross-component features only work if you have loaded at least one file
27
27
from each component.
28
-
3. There is a known issue where if you have three components, such that A depends on B which depends on C
29
-
then if you load A and C into the session but not B then under certain situations you
30
-
can get strange errors about a type coming from two different places. See [this repo](https://github.com/fendor/ghcide-bad-interface-files) for
31
-
a simple reproduction of the bug.
32
28
33
29
## Using it
34
30
35
31
`ghcide` is not an end-user tool, [don't use `ghcide`](https://neilmitchell.blogspot.com/2020/09/dont-use-ghcide-anymore-directly.html) directly (more about the rationale [here](https://github.com/haskell/ghcide/pull/939)).
36
32
37
-
[`haskell-language-server`](http://github.com/haskell/haskell-language-server) is an LSP server built on top of `ghcide` with additional features and a user friendly deployment model. To get it, simply install the [Haskell extension](https://marketplace.visualstudio.com/items?itemName=haskell.haskell) in VS Code, or download prebuilt binaries from the [haskell-language-server](https://github.com/haskell/haskell-language-server) project page.
33
+
[`haskell-language-server`](http://github.com/haskell/haskell-language-server) is an LSP server built on top of `ghcide` with additional features and a user friendly deployment model. To get it, simply install the [Haskell extension](https://marketplace.visualstudio.com/items?itemName=haskell.haskell) in VS Code, or download prebuilt binaries from [GHCup](https://www.haskell.org/ghcup/).
38
34
39
35
40
36
The instructions below are meant for developers interested in setting up ghcide as an LSP server for testing purposes.
41
37
42
38
### Install `ghcide`
43
39
44
-
#### With Nix
45
-
46
-
Note that you need to compile `ghcide` with the same `ghc` as the project you are working on.
47
-
48
-
1. If the `ghc` you are using matches the version (or better is) from `nixpkgs` it‘s easiest to use the `ghcide` from `nixpkgs`. You can do so via
49
-
```
50
-
nix-env -iA haskellPackages.ghcide
51
-
```
52
-
or e.g. including `pkgs.haskellPackages.ghcide` in your projects `shell.nix`.
53
-
Depending on your `nixpkgs` channel that might not be the newest `ghcide`, though.
54
-
55
-
2. If your `ghc` does not match nixpkgs you should try the [ghcide-nix repository](https://github.com/cachix/ghcide-nix)
56
-
which provides a `ghcide` via the `haskell.nix` infrastructure.
57
40
58
41
#### With Cabal or Stack
59
42
60
43
First install the `ghcide` binary using `stack` or `cabal`, e.g.
Of the 158 files in Shake, as of this moment, 152 can be loaded by the IDE, but 6 can't (error messages for the reasons they can't be loaded are given earlier). The failing files are all prototype work or test output, meaning I can confidently use Shake.
84
67
85
-
The `ghcide` executable mostly relies on [`hie-bios`](https://github.com/mpickering/hie-bios) to do the difficult work of setting up your GHC environment. If it doesn't work, see [the `hie-bios` manual](https://github.com/mpickering/hie-bios#readme) to get it working. My default fallback is to figure it out by hand and create a `direct` style [`hie.yaml`](https://github.com/ndmitchell/shake/blob/master/hie.yaml) listing the command line arguments to load the project.
68
+
The `ghcide` executable mostly relies on [`hie-bios`](https://github.com/haskell/hie-bios) to do the difficult work of setting up your GHC environment. If it doesn't work, see [the `hie-bios` manual](https://github.com/haskell/hie-bios#readme) to get it working. My default fallback is to figure it out by hand and create a `direct` style [`hie.yaml`](https://github.com/ndmitchell/shake/blob/master/hie.yaml) listing the command line arguments to load the project.
86
69
87
70
If you can't get `ghcide` working outside the editor, see [this setup troubleshooting guide](https://github.com/haskell/haskell-language-server/tree/master/ghcide/docs/Setup.md). Once you have got `ghcide` working outside the editor, the next step is to pick which editor to integrate with.
88
71
@@ -94,10 +77,6 @@ If you can't get `ghcide` working outside the editor, see [this setup troublesho
94
77
95
78
The [Haskell](https://marketplace.visualstudio.com/items?itemName=haskell.haskell) extension has a setting for ghcide.
96
79
97
-
### Using with Atom
98
-
99
-
You can follow the [instructions](https://github.com/moodmosaic/ide-haskell-ghcide#readme) to install with `apm`.
0 commit comments