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
* Documentation: Improve "Contributing"
Also fix some warnings when compiling the documentation with Sphinx.
* Documentation: Nix uses `make` to build documentation
Copy file name to clipboardExpand all lines: docs/contributing/contributing.md
+39-46
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,9 @@
2
2
3
3
The Haskell tooling dream is near, we need your help!
4
4
5
-
## How to contact the haskell ide team
5
+
## How to contact the Haskell Language Server (HLS) team
6
6
7
-
- Join the [haskell-language-server channel](https://matrix.to/#/#haskell-language-server:matrix.org)in[matrix](https://matrix.org/) (primary communication channel).
7
+
- Join the [haskell-language-server channel](https://matrix.to/#/#haskell-language-server:matrix.org)on[matrix](https://matrix.org/) (primary communication channel).
8
8
- Join [our IRC channel](https://web.libera.chat/?channels=#haskell-language-server) at `#haskell-language-server` on [`libera`](https://libera.chat/) (secondary communication channel - all messages in this IRC channel are automatically bridged to the Matrix channel).
9
9
- Visit [the project GitHub repo](https://github.com/haskell/haskell-language-server) to view the source code, or open issues or pull requests.
The project can then be built with both `cabal build` and `stack build`.
19
19
20
-
### Using Cabal
20
+
### Building with Cabal
21
21
22
22
```shell
23
23
# If you have not run `cabal update` in a while
@@ -26,15 +26,15 @@ $ cabal update
26
26
$ cabal build
27
27
```
28
28
29
-
### Using Stack
29
+
### Building with Stack
30
30
31
31
```shell
32
32
$ stack build
33
33
```
34
34
35
-
### Using Nix
35
+
### Building with Nix
36
36
37
-
The instructions below show how to set up a Cachix binary cache and open a nix shell for local development.
37
+
The instructions below show how to set up a Cachix binary cache and open a Nix shell for local development.
38
38
39
39
```shell
40
40
$ cachix use haskell-language-server
@@ -45,19 +45,19 @@ $ cabal build
45
45
46
46
#### Flakes support
47
47
48
-
If you are using nix 2.4 style command (enabled by `experimental-features = nix-command`),
48
+
If you are using Nix 2.4 style commands (enabled by `experimental-features = nix-command`),
49
49
you can use `nix develop` instead of `nix-shell` to enter the development shell. To enter the shell with specific GHC versions:
50
50
51
-
*`nix develop` - default GHC version
52
-
*`nix develop .#shell-ghc90` - GHC 9.0.1 (substitute GHC version as appropriate)
51
+
*`nix develop` - default GHC version,
52
+
*`nix develop .#shell-ghc90` - GHC 9.0.1 (substitute GHC version as appropriate).
53
53
54
-
If you are looking for a Nix expression to create haskell-language-server binaries, see https://github.com/haskell/haskell-language-server/issues/122
54
+
If you are looking for a Nix expression to create `haskell-language-server` binaries, see https://github.com/haskell/haskell-language-server/issues/122
55
55
56
56
## Testing
57
57
58
58
The tests make use of the [Tasty](https://github.com/feuerbach/tasty) test framework.
59
59
60
-
There are two test suites in the main haskell-language-server package, functional tests, and wrapper tests.
60
+
There are two test suites in the main `haskell-language-server` package, functional tests, and wrapper tests.
61
61
Some of the wrapper tests expect `stack` to be present on the system, or else they fail.
62
62
Other project packages, like the core library or plugins, can have their own test suite.
63
63
@@ -92,7 +92,7 @@ $ cabal test hls-refactor-plugin-tests
92
92
Running a subset of tests
93
93
94
94
Tasty supports providing
95
-
[Patterns](https://github.com/feuerbach/tasty#patterns) as command
95
+
[patterns](https://github.com/feuerbach/tasty#patterns) as command
96
96
line arguments, to select the specific tests to run.
97
97
98
98
```bash
@@ -126,7 +126,7 @@ If you want to test HLS while hacking on it (you can even test it on HLS codebas
126
126
3. (Every time you change the HLS code) Rebuild HLS
127
127
4. (Every time you change the HLS code) Restart the LSP workspace
128
128
129
-
### Find the path to the hacked HLS you build
129
+
### Find the path to your HLS build
130
130
Note that unless you change the GHC version or the HLS version between builds, the path should remain the same, this is why you need to set it only once.
@@ -180,73 +180,66 @@ There are several ways to configure the HLS server path:
180
180
181
181
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.
182
182
However, most editors will need some action to honour those settings automatically.
183
-
For example vscode needs to have installed a specific [extension](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig).
183
+
For example VS Code needs to have installed a specific [extension](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig).
184
184
Please, try to follow those basic settings to keep the codebase as uniform as possible.
185
185
186
186
### Formatter pre-commit hook
187
187
188
-
We are using [pre-commit](https://pre-commit.com/) to configure git pre-commit hook for formatting. Although it is possible to run formatting manually, we recommend you to use it to set pre-commit hook as our CI checks pre-commit hook is applied or not.
188
+
We are using [pre-commit](https://pre-commit.com/) to configure the git pre-commit hook for formatting. Although it is possible to format code manually, we recommend you to use the pre-commit hook as our CI checks if the hook was applied or not.
189
189
190
-
If you are using Nix or Gitpod, pre-commit hook is automatically installed. Otherwise, follow instructions on
191
-
[https://pre-commit.com/](https://pre-commit.com/) to install the `pre-commit` tool, then run the following command:
190
+
If you are using Nix or Gitpod, the pre-commit hook is automatically installed. Otherwise, follow the instructions on
191
+
[https://pre-commit.com/](https://pre-commit.com/) to install the `pre-commit` tool. Then run the following command:
192
192
193
193
```sh
194
194
pre-commit install
195
195
```
196
196
197
-
#### Why some components are excluded from automatic formatting?
197
+
#### Why are some components excluded from automatic formatting?
198
198
199
-
-`test/testdata` and `test/data` are there as we want to test formatting plugins.
200
-
-`hie-compat` is there as we want to keep its code as close to GHC as possible.
199
+
-`test/testdata` and `test/data` are excluded because we want to test formatting plugins.
200
+
-`hie-compat` is excluded because we want to keep its code as close to GHC as possible.
201
201
202
-
## Introduction tutorial
202
+
## Plugin tutorial
203
203
204
-
See the [tutorial](./plugin-tutorial.md) on writing a plugin in HLS.
204
+
See the [tutorial on writing a plugin in HLS](./plugin-tutorial.md).
205
205
206
206
## Measuring, benchmarking and tracing
207
207
208
208
### Benchmarks
209
209
210
-
If you are touching performance sensitive code, take the time to run a differential
211
-
benchmark between HEAD and master using the benchHist script. This assumes that
212
-
"master" points to the upstream master.
210
+
If you are touching performance sensitive code, take the time to run a differential benchmark between `HEAD` and `origin/master` (see [bench/README](https://github.com/haskell/haskell-language-server/blob/master/bench/README.md)).
213
211
214
-
Run the benchmarks with `cabal bench`.
215
-
216
-
It should take around 25 minutes and the results will be stored in the `bench-results` folder. To interpret the results, see the comments in the `bench/Main.hs` module.
217
-
218
-
More details in [bench/README](https://github.com/haskell/haskell-language-server/blob/master/bench/README.md)
212
+
Run the benchmarks with `cabal bench`. The runtime is about 25 minutes and the results will be stored in the `bench-results` folder. To interpret the results, see the comments in the [bench/Main.hs](https://github.com/haskell/haskell-language-server/blob/master/bench/Main.hs) module.
219
213
220
214
### Tracing
221
215
222
-
HLS records opentelemetry [eventlog traces](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/runtime_control.html#rts-eventlog) via [opentelemetry](https://hackage.haskell.org/package/opentelemetry). To generate the traces, build with `-eventlog` and run with `+RTS -l`. To visualize the traces, install [Tracy](https://github.com/wolfpld/tracy) and use [eventlog-to-tracy](https://hackage.haskell.org/package/opentelemetry-extra) to open the generated eventlog.
216
+
HLS records [eventlog traces](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/runtime_control.html#rts-eventlog) via [opentelemetry](https://hackage.haskell.org/package/opentelemetry). To generate the traces, build with `-eventlog` and run with `+RTS -l`. To visualize the traces, install [Tracy](https://github.com/wolfpld/tracy) and use [eventlog-to-tracy](https://hackage.haskell.org/package/opentelemetry-extra) to open the generated eventlog.
223
217
224
218
## Adding support for a new editor
225
219
226
220
Adding support for new editors is fairly easy if the editor already has good support for generic LSP-based extensions.
227
-
In that case, there will likely be an editor-specific support system for this (like`lsp-mode` for Emacs).
228
-
This will typically provide instructions for how to support new languages.
221
+
In that case, there will likely be an editor-specific support system (e.g.,`lsp-mode` for Emacs).
222
+
The support system will typically provide instructions for how to add support for new languages.
229
223
230
-
In some cases you may need to write a small bit of additional client support, or expose a way for the user to set the server's [configuration options](../configuration.md#configuring-haskell-language-server) and
231
-
for them to configure how the server is started.
224
+
In some cases you may need to write a small bit of additional client support, or expose a way for the user to set the server's [configuration options](../configuration.md#configuring-haskell-language-server) and for them to configure how the server is started.
232
225
233
-
## Building the docs
226
+
## Building the documentation
234
227
235
-
The docs are built with [Sphinx](https://www.sphinx-doc.org/en/master/) and [ReadTheDocs](https://docs.readthedocs.io/en/stable/index.html), the documentation for both is helpful.
228
+
The documentation is built with [Sphinx](https://www.sphinx-doc.org/en/master/) and [ReadTheDocs](https://docs.readthedocs.io/en/stable/index.html), the documentation of both is helpful.
236
229
237
-
To build the docs you need to install some Python prerequisites. You can either `pip install -r docs/requirements.txt`, or simply enter a `nix-shell`.
230
+
You need to install some Python prerequisites. You can either `pip install -r docs/requirements.txt`, or simply enter a `nix-shell`.
238
231
239
-
Then to build and preview the docs:
232
+
Then to build and preview the documentation:
240
233
241
234
```
242
235
cd docs
243
236
make html
244
237
firefox _build/html/index.html
245
238
```
246
239
247
-
Alternatively, you can build the entire thing as a Nix derivation from the flake with `nix build .#docs`.
240
+
Alternatively, you can build the documentation as a Nix derivation from the Flake with `nix build .#docs`.
248
241
249
-
The docs are also built and previewed on every PR, so you can check them from the PR status.
242
+
The documentation is also built and previewed on every PR, so you can check them from the PR status.
250
243
251
244
## Working on code actions
252
245
@@ -255,8 +248,8 @@ To make HLS easier to maintain, please follow these design guidelines when addin
255
248
1. Prefer `ghc-exactprint` to manual text parsing.
256
249
2. Prefer `ghc-exactprint` to manual code generation.
257
250
3. Code generating actions should not try to format the generated code. Assume that the user is also leveraging HLS for automated code formatting.
258
-
4. Put new code actions in their own plugin unless they are very closely aligned with an existing ghcide code action.
251
+
4. Put new code actions in their own plugin unless they are very closely aligned with an existing code action.
259
252
260
253
## Sponsorship
261
254
262
-
If you want to contribute financially you can do so via [open-collective](https://opencollective.com/haskell-language-server). In the past the funding has been used to sponsor [summer student projects](https://mpickering.github.io/ide/posts/2021-07-22-summer-of-hls.html).
255
+
If you want to contribute financially, you can do so via [open-collective](https://opencollective.com/haskell-language-server). In the past, the funding was used to sponsor [summer student projects](https://mpickering.github.io/ide/posts/2021-07-22-summer-of-hls.html).
Copy file name to clipboardExpand all lines: docs/what-is-hls.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# What is haskell-language-server?
1
+
# What is the Haskell Language Server?
2
2
3
-
The `haskell-language-server`(HLS) project is an implementation of a server (a "language server") for the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/) (LSP).
3
+
The Haskell Language Server (HLS) is an implementation of a server (a "language server") for the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/) (LSP).
4
4
A language server talks to a client (typically an editor), which can ask the server to perform various operations, such as reporting errors or providing code completions.
5
5
The advantage of this system is that clients and servers can interoperate more easily so long as they all speak the LSP protocol.
6
6
In the case of HLS, that means that it can be used with many different editors, since editor support for the LSP protocol is now widespread.
@@ -35,7 +35,7 @@ Here are a few pieces of jargon that you may come across in the HLS docs or when
35
35
-*Semantic highlighting*: Special syntax highlighting performed by the server.
36
36
-*Method*: A LSP method is a function in the LSP protocol that the client can invoke to perform some action, e.g. ask for completions at a point.
37
37
38
-
## haskell-language-server
38
+
## Haskell Language Server
39
39
40
40
### HLS and its wrapper
41
41
@@ -51,7 +51,7 @@ Plugins can also be disabled independently to allow users to customize the behav
51
51
52
52
These plugins all (currently) live in the HLS repository and are developed in tandem with the core HLS functionality.
53
53
54
-
See the [configuration page](./configuration.md#generic-plugin-configuration) for more on configuring plugins.
54
+
See the [configuration page](./configuration.md#Generic pluginconfiguration) for more on configuring plugins.
0 commit comments