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
The project can then be built with both `cabal build` and `stack build`.
21
21
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
-
27
22
### Using Cabal
28
23
29
24
```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
32
29
```
33
30
34
31
### Using Stack
35
32
36
33
```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
42
34
$ stack build
43
35
```
44
36
@@ -119,26 +111,39 @@ An alternative, which only recompiles when tests (or dependencies) change:
119
111
$ cabal run haskell-language-server:func-test -- -p "hlint enables"
120
112
```
121
113
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.
123
126
127
+
### Manually testing your hacked HLS
124
128
If you want to test HLS while hacking on it, follow the steps below.
125
129
126
130
To do once:
127
131
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)
129
133
- Configure this editor to use your custom HLS executable
130
134
- With Cabal:
131
135
- On Unix systems: `cabal exec which haskell-language-server`
132
136
- On Windows: `cabal exec where haskell-language-server`
133
137
- With Stack: `$(stack path --dist-dir)/build/haskell-language-server/haskell-language-server`
134
138
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:
136
140
137
141
- Build HLS
138
142
- With Cabal: `cabal build exe:haskell-language-server`
139
143
- With Stack: `stack build haskell-language-server:exe:haskell-language-server`
140
144
- Restart HLS
141
145
- With VS Code: `Haskell: Restart Haskell LSP Server`
0 commit comments