Skip to content

Commit 26f55de

Browse files
author
Julien Debon
committed
Update documentation on using HIE with HLS
Followup of haskell#1230
1 parent 2feabf3 commit 26f55de

File tree

3 files changed

+21
-22
lines changed

3 files changed

+21
-22
lines changed

docs/contributing/contributing.md

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The Haskell tooling dream is near, we need your help!
1010
- Join the [haskell-tooling channel](https://matrix.to/#/#haskell-tooling:matrix.org) in [matrix](https://matrix.org/).
1111
- Visit [the project GitHub repo](https://github.com/haskell/haskell-language-server) to view the source code, or open issues or pull requests.
1212

13-
## Building haskell-language-server
13+
## Building
1414

1515
Clone the repository:
1616
```shell
@@ -19,26 +19,18 @@ $ git clone https://github.com/haskell/haskell-language-server
1919

2020
The project can then be built with both `cabal build` and `stack build`.
2121

22-
haskell-language-server can also be used with itself. We provide preset samples of `hie.yaml` for Cabal and Stack.
23-
24-
Note: the `./install/` folder is not directly tied to the project so it has dedicated `./install/hie.yaml.[cbl|stack]`
25-
templates.
26-
2722
### Using Cabal
2823

2924
```shell
30-
$ cp hie-cabal.yaml hie.yaml
31-
$ cp install/hie-cabal.yaml install/hie.yaml
25+
# If you have not run `cabal update` in a while
26+
$ cabal update
27+
# Then
28+
$ cabal build
3229
```
3330

3431
### Using Stack
3532

3633
```shell
37-
$ cp hie-stack.yaml hie.yaml
38-
$ cp install/hie-stack.yaml install/hie.yaml
39-
$ cp ghcide/hie-stack.yaml ghcide/hie.yaml
40-
$ stack build --test --no-run-tests
41-
$ cd install
4234
$ stack build
4335
```
4436

@@ -119,26 +111,39 @@ An alternative, which only recompiles when tests (or dependencies) change:
119111
$ cabal run haskell-language-server:func-test -- -p "hlint enables"
120112
```
121113

122-
### Test your hacked HLS in your editor
114+
## Using HLS on HLS code
115+
116+
[HLS project configuration guidelines](../configuration.md#configuring-your-project-build) also apply to the HLS project itself.
117+
118+
Note: HLS implicitly detects HLS codebase as a Stack project (see [hie-bios implicit configuration documentation](https://github.com/haskell/hie-bios/blob/master/README.md#implicit-configuration)).
119+
If you want HLS to use Cabal, you need to create an `hie.yaml` file:
120+
```yaml
121+
cradle:
122+
cabal:
123+
```
124+
125+
Also note that the `install/` subdirectory is a different project, so if you want to work on this part of the code, you may also have to create an `install/hie.yaml` file.
123126

127+
### Manually testing your hacked HLS
124128
If you want to test HLS while hacking on it, follow the steps below.
125129

126130
To do once:
127131

128-
- Open some codebase on which you want to test your hacked HLS in your favorite editor
132+
- Open some codebase on which you want to test your hacked HLS in your favorite editor (it can also be HLS codebase itself: see previous section for configuration)
129133
- Configure this editor to use your custom HLS executable
130134
- With Cabal:
131135
- On Unix systems: `cabal exec which haskell-language-server`
132136
- On Windows: `cabal exec where haskell-language-server`
133137
- With Stack: `$(stack path --dist-dir)/build/haskell-language-server/haskell-language-server`
134138

135-
To do every time you changed code and want to test it:
139+
To do every time you change HLS code and want to test it:
136140

137141
- Build HLS
138142
- With Cabal: `cabal build exe:haskell-language-server`
139143
- With Stack: `stack build haskell-language-server:exe:haskell-language-server`
140144
- Restart HLS
141145
- With VS Code: `Haskell: Restart Haskell LSP Server`
146+
- With Emacs: `lsp-workspace-restart`
142147

143148
## Style guidelines
144149

install/hie-cabal.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

install/hie-stack.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)