@@ -1,4 +1,4 @@
1−# `hie-core` (Haskell IDE engine)
1+# `ghcide`
22
33Our vision is that you should build an IDE by combining:
44
@@ -6,7 +6,7 @@ Our vision is that you should build an IDE by combining:
66<img style="float:right;" src="img/vscode2.png"/>
77
88* [`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;
9−* `hie-core` (i.e. this library) for defining how to type check, when to type check, and producing diagnostic messages;
9+* `ghcide` (i.e. this library) for defining how to type check, when to type check, and producing diagnostic messages;
1010* 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;
1111* [`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;
1212* An extension for your editor. We provide a [VS Code extension](https://code.visualstudio.com/api) as `extension` in this directory, although the components work in other LSP editors too (see below for instructions using Emacs).
@@ -15,7 +15,7 @@ There are more details about our approach [in this blog post](https://4ta.uk/p/s
1515
1616## Using it
1717
18−### Install `hie-core`
18+### Install `ghcide`
1919
2020#### With Nix
2121
@@ -23,17 +23,17 @@ There are more details about our approach [in this blog post](https://4ta.uk/p/s
2323
2424#### With Cabal or Stack
2525
26−First install the `hie-core` binary using `stack` or `cabal`, e.g.
26+First install the `ghcide` binary using `stack` or `cabal`, e.g.
2727
28281. `git clone https://github.com/digital-asset/daml.git`
29−2. `cd daml/compiler/hie-core`
29+2. `cd daml/compiler/ghcide`
30303. `cabal install` or `stack install` (and make sure `~/.local/bin` is on your `$PATH`)
3131
32−It's important that `hie-core` is compiled with the same compiler you use to build your projects.
32+It's important that `ghcide` is compiled with the same compiler you use to build your projects.
3333
34−### Test `hie-core`
34+### Test `ghcide`
3535
36−Next, check that `hie-core` is capable of loading your code. Change to the project directory and run `hie-core`, which will try and load everything using the same code as the IDE, but in a way that's much easier to understand. For example, taking the example of [`shake`](https://github.com/ndmitchell/shake), running `hie-core` gives some error messages and warnings before reporting at the end:
36+Next, check that `ghcide` is capable of loading your code. Change to the project directory and run `ghcide`, which will try and load everything using the same code as the IDE, but in a way that's much easier to understand. For example, taking the example of [`shake`](https://github.com/ndmitchell/shake), running `ghcide` gives some error messages and warnings before reporting at the end:
3737
3838```
3939Files that worked: 152
@@ -49,21 +49,21 @@ Done
4949
5050Of 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.
5151
52−The `hie-core` 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.
52+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.
5353
54−Once you have got `hie-core` working outside the editor, the next step is to pick which editor to integrate with.
54+Once you have got `ghcide` working outside the editor, the next step is to pick which editor to integrate with.
5555
5656### Using with VS Code
5757
5858Install the VS code extension (see https://code.visualstudio.com/docs/setup/mac for details on adding `code` to your `$PATH`):
5959
60−1. `cd compiler/hie-core/extension`
60+1. `cd compiler/ghcide/extension`
61612. `npm ci`
62623. `npm install vsce --global` (may require `sudo`)
63634. `vsce package`
64−5. `code --install-extension hie-core-0.0.1.vsix`
64+5. `code --install-extension ghcide-0.0.1.vsix`
6565
66−Now openning a `.hs` file should work with `hie-core`.
66+Now openning a `.hs` file should work with `ghcide`.
6767
6868### Using with Emacs
6969
@@ -86,7 +86,7 @@ If you don't already have [MELPA](https://melpa.org/#/) package installation con
8686(use-package lsp-haskell
8787 :ensure t
8888 :config
89− (setq lsp-haskell-process-path-hie "hie-core")
89+ (setq lsp-haskell-process-path-hie "ghcide")
9090 (setq lsp-haskell-process-args-hie '())
9191 ;; Comment/uncomment this line to see interactions between lsp client/server.
9292 ;;(setq lsp-log-io t)
@@ -103,7 +103,7 @@ Add this to your vim config:
103103let g:LanguageClient_rootMarkers = ['*.cabal', 'stack.yaml']
104104let g:LanguageClient_serverCommands = {
105105 \ 'rust': ['rls'],
106− \ 'haskell': ['hie-core', '--lsp'],
106+ \ 'haskell': ['ghcide', '--lsp'],
107107 \ }
108108```
109109
@@ -116,8 +116,8 @@ Add this to your vim config:
116116
117117```vim
118118au User lsp_setup call lsp#register_server({
119− \ 'name': 'hie-core',
120− \ 'cmd': {server_info->['/your/path/to/hie-core', '--lsp']},
119+ \ 'name': 'ghcide',
120+ \ 'cmd': {server_info->['/your/path/to/ghcide', '--lsp']},
121121 \ 'whitelist': ['haskell'],
122122 \ })
123123```