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/contributing/contributing.md
+38-13Lines changed: 38 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -138,24 +138,49 @@ cradle:
138
138
### Manually testing your hacked HLS
139
139
If you want to test HLS while hacking on it, follow the steps below.
140
140
141
-
To do once:
141
+
#### Using Cabal
142
142
143
-
- 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)
144
-
- Configure this editor to use your custom HLS executable
145
-
- With Cabal:
146
-
- On Unix systems: `cabal exec which haskell-language-server`
147
-
- On Windows: `cabal exec where haskell-language-server`
148
-
- With Stack: `$(stack path --dist-dir)/build/haskell-language-server/haskell-language-server`
143
+
- Whenever you want to build HLS, call `cabal install exe:haskell-language-server --overwrite-policy=always`.
144
+
In the output you will find the path the HLS executable was installed to, i.e.:
149
145
150
-
To do every time you change HLS code and want to test it:
- With Cabal: `cabal build exe:haskell-language-server`
154
-
- With Stack: `stack build haskell-language-server:exe:haskell-language-server`
155
-
- Restart HLS
156
-
- With VS Code: `Haskell: Restart Haskell LSP Server`
154
+
In this example output, the path would be `/home/user/.cabal/bin/haskell-language-server`.
155
+
156
+
- Open some codebase on which you want to test your local HLS in your favorite editor (it can also be the HLS codebase itself: see previous section for configuration)
157
+
- Configure this editor to use your custom HLS executable by using the path you obtained previously.
158
+
- Restart HLS in your project:
159
+
- With VS Code: Press `CTRL + Shift + P` and type `Haskell: Restart Haskell LSP Server`
157
160
- With Emacs: `lsp-workspace-restart`
158
161
162
+
##### VS Code
163
+
164
+
When using VS Code you can set up a test project to use a specific HLS executable:
165
+
166
+
- If it doesn't already exist in your project directory, create a directory called `.vscode`.
167
+
- In the `.vscode` directory create a file called `settings.json` with the below contents. The path used here is the one obtained by using the `cabal` install command.
- Open some codebase on which you want to test your local HLS in your favorite editor (it can also be the HLS codebase itself: see previous section for configuration)
178
+
- Configure this editor to use your custom HLS executable
179
+
- To obtain the path to your local HLS executable: `$(stack path --dist-dir)/build/haskell-language-server/haskell-language-server`
The project includes a [`.editorconfig`](https://editorconfig.org)[file](https://github.com/haskell/haskell-language-server/blob/master/.editorconfig) with the editor basic settings used by the project.
0 commit comments