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
#### Note for contributors using WSL (Windows Subsystem for Linux)
19
+
**Note** for contributors using WSL (Windows Subsystem for Linux)
19
20
20
21
When building HLS in WSL, clone and build the repository from the Linux filesystem (e.g. `~/dev`), not from Windows-mounted paths like `/mnt/c`, as this can cause permission or build issues.
21
22
@@ -39,36 +40,37 @@ $ cabal build
39
40
```
40
41
41
42
If you encounter memory-related build failures, try reducing peak memory usage by running:
42
-
```
43
+
44
+
```shell
43
45
cabal build -j1
44
46
```
45
47
46
48
### Building with Stack
47
49
48
50
```shell
49
-
$ stack build
51
+
stack build
50
52
```
51
53
52
54
### Building with Nix
53
55
54
56
The instructions below show how to set up a Cachix binary cache and open a Nix shell for local development.
55
57
56
58
```shell
57
-
$ cachix use haskell-language-server
58
-
$ nix-shell
59
-
$ cabal update
60
-
$ cabal build
59
+
cachix use haskell-language-server
60
+
nix-shell
61
+
cabal update
62
+
cabal build
61
63
```
62
64
63
65
#### Flakes support
64
66
65
67
If you are using Nix 2.4 style commands (enabled by `experimental-features = nix-command`),
66
68
you can use `nix develop` instead of `nix-shell` to enter the development shell. To enter the shell with specific GHC versions:
67
69
68
-
*`nix develop` - default GHC version,
69
-
*`nix develop .#shell-ghc90` - GHC 9.0.1 (substitute GHC version as appropriate).
70
+
-`nix develop` - default GHC version,
71
+
-`nix develop .#shell-ghc90` - GHC 9.0.1 (substitute GHC version as appropriate).
70
72
71
-
If you are looking for a Nix expression to create `haskell-language-server` binaries, see https://github.com/haskell/haskell-language-server/issues/122
73
+
If you are looking for a Nix expression to create `haskell-language-server` binaries, see <https://github.com/haskell/haskell-language-server/issues/122>
72
74
73
75
## Testing
74
76
@@ -83,19 +85,19 @@ Other project packages, like the core library or plugins, can have their own tes
83
85
Running all the tests
84
86
85
87
```bash
86
-
$ cabal test
88
+
cabal test
87
89
```
88
90
89
91
Running just the functional tests
90
92
91
93
```bash
92
-
$ cabal test func-test
94
+
cabal test func-test
93
95
```
94
96
95
97
Running just the wrapper tests
96
98
97
99
```bash
98
-
$ cabal test wrapper-test
100
+
cabal test wrapper-test
99
101
```
100
102
101
103
Running just the tests for a specific plugin
@@ -113,14 +115,14 @@ Tasty supports providing
113
115
line arguments, to select the specific tests to run.
114
116
115
117
```bash
116
-
$ cabal test func-test --test-option "-p hlint"
118
+
cabal test func-test --test-option "-p hlint"
117
119
```
118
120
119
121
The above recompiles everything every time you use a different test option though.
120
122
An alternative, which only recompiles when tests (or dependencies) change is to pass the `TASTY_PATTERN` environment variable:
121
123
122
124
```bash
123
-
$ TASTY_PATTERN='hlint' cabal test func-test
125
+
TASTY_PATTERN='hlint' cabal test func-test
124
126
```
125
127
126
128
## Using HLS on HLS code
@@ -136,6 +138,7 @@ cradle:
136
138
```
137
139
138
140
## Manually testing your hacked HLS
141
+
139
142
If you want to test HLS while hacking on it (you can even test it on HLS codebase itself, see previous section), you need to:
140
143
141
144
1. (Once) Find the path to the hacked HLS you build
@@ -144,18 +147,23 @@ If you want to test HLS while hacking on it (you can even test it on HLS codebas
144
147
4. (Every time you change the HLS code) Restart the LSP workspace
145
148
146
149
### Find the path to your HLS build
150
+
147
151
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.
There are several ways to configure the HLS server path, each of which depends on your choice of language server provider (e.g., emacs-lsp or eglot). If using emacs-lsp, you need to configure the variable `lsp-haskell-server-path`:
191
+
180
192
-`M-x customize-group<RET>lsp-haskell<RET>Lsp Haskell Server Path`
0 commit comments