Skip to content

Commit 545636a

Browse files
blackheavenfendor
andauthored
Apply suggestions from code review
Co-authored-by: fendor <[email protected]>
1 parent 2a38710 commit 545636a

File tree

1 file changed

+7
-28
lines changed

1 file changed

+7
-28
lines changed

docs/components/ghcide.md

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Our vision is that you should build an IDE by combining:
88

99
* [`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;
1010
* `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;
1313
* An LSP client for your editor.
1414

1515
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
2525
projects, it is always advised to specify explicitly how your project partitions.
2626
2. Cross-component features only work if you have loaded at least one file
2727
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.
3228

3329
## Using it
3430

3531
`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)).
3632

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/).
3834

3935

4036
The instructions below are meant for developers interested in setting up ghcide as an LSP server for testing purposes.
4137

4238
### Install `ghcide`
4339

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.
5740

5841
#### With Cabal or Stack
5942

6043
First install the `ghcide` binary using `stack` or `cabal`, e.g.
6144

62-
1. `git clone https://github.com/haskell/ghcide.git`
63-
2. `cd ghcide`
64-
3. `cabal install` or `stack install` (and make sure `~/.local/bin` is on your `$PATH`)
45+
1. `git clone https://github.com/haskell/haskell-language-server.git`
46+
2. `cd haskell-language-server`
47+
3. `cabal install exe:ghcide` or `stack install ghcide` (and make sure `~/.local/bin` is on your `$PATH`)
6548

6649
It's important that `ghcide` is compiled with the same compiler you use to build your projects.
6750

@@ -82,7 +65,7 @@ Completed (152 worked, 6 failed)
8265

8366
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.
8467

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.
8669

8770
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.
8871

@@ -94,10 +77,6 @@ If you can't get `ghcide` working outside the editor, see [this setup troublesho
9477

9578
The [Haskell](https://marketplace.visualstudio.com/items?itemName=haskell.haskell) extension has a setting for ghcide.
9679

97-
### Using with Atom
98-
99-
You can follow the [instructions](https://github.com/moodmosaic/ide-haskell-ghcide#readme) to install with `apm`.
100-
10180
### Using with Sublime Text
10281

10382
* Install [LSP](https://packagecontrol.io/packages/LSP)

0 commit comments

Comments
 (0)