@@ -26,7 +26,17 @@ You can check if HLS is available for your platorm via ghcup here: <https://hask
26
26
You can also install HLS from source without checking out the code manually:
27
27
28
28
``` bash
29
- ghcup compile hls -v 1.4.0 8.10.7
29
+ ghcup compile hls -v 1.6.1.0 --ghc 8.10.7
30
+ ```
31
+
32
+ Install HLS for multiple GHC versions:
33
+ ```
34
+ ghcup compile hls -v 1.6.1.0 --ghc 8.10.7 --ghc 8.8.4
35
+ ```
36
+
37
+ Use a different ` cabal.project ` for a GHC version:
38
+ ```
39
+ ghcup compile hls -v 1.6.1.0 --ghc 9.2.1 --cabal-project https://github.com/haskell/haskell-language-server/blob/master/cabal-ghc921.project
30
40
```
31
41
32
42
Check ` ghcup compile hls --help ` for a full list of compilation options.
@@ -83,147 +93,6 @@ pkg install hs-haskell-language-server
83
93
to install it. At the moment, HLS installed this way only supports the same GHC
84
94
version as the ports one.
85
95
86
- # # Installation from source
87
-
88
- # ## Common pre-requirements
89
-
90
- - ` stack` or ` cabal` must be in your PATH
91
- - You need stack version > = 2.1.1 or cabal > = 2.4.0.0
92
- - ` git` must be in your PATH
93
- - The directory where ` stack` or ` cabal` put the binaries must be in you PATH:
94
- - For stack you can get it with ` stack path --local-bin`
95
- - For cabal it is by default ` $HOME /.cabal/bin` in linux and ` %APPDATA%\c abal\b in` in windows.
96
-
97
- Tip: you can quickly check if some command is in your path by running the command.
98
- If you receive some meaningful output instead of " command not found" -like message
99
- then it means you have the command in PATH.
100
-
101
- # ## Linux-specific pre-requirements
102
-
103
- On Linux you will need install a couple of extra libraries:
104
-
105
- - [Unicode (ICU)](http://site.icu-project.org/)
106
- - [NCURSES](https://www.gnu.org/software/ncurses/)
107
- - [Zlib](https://zlib.net/)
108
-
109
- ** Debian 9/Ubuntu 18.04 or earlier** :
110
-
111
- ` ` ` bash
112
- sudo apt install libicu-dev libtinfo-dev libgmp-dev zlib1g-dev
113
- ` ` `
114
-
115
- ** Debian 10/Ubuntu 18.10 or later** :
116
-
117
- ` ` ` bash
118
- sudo apt install libicu-dev libncurses-dev libgmp-dev zlib1g-dev
119
- ` ` `
120
-
121
- ** Fedora** :
122
-
123
- ` ` ` bash
124
- sudo dnf install libicu-devel ncurses-devel zlib-devel
125
- ` ` `
126
-
127
- # ## Windows-specific pre-requirements
128
-
129
- In order to avoid problems with long paths on Windows you can do either one of the following:
130
-
131
- 1. Clone the ` haskell-language-server` to a short path, for example the root of your logical drive (e.g. to
132
- ` C:\h ls` ). Even if you choose ` C:\h askell-language-server` you could hit the problem. If this doesn' t work or you want to use a longer path, try the second option.
133
-
134
- 2. If the `Local Group Policy Editor` is available on your system, go to: `Local Computer Policy -> Computer Configuration -> Administrative Templates -> System -> Filesystem` set `Enable Win32 long paths` to `Enabled`. If you don' t have the policy editor you can use regedit by using the following instructions [here](https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#enable-long-paths-in-windows-10-version-1607-and-later). You also need to configure git to allow longer paths by using unicode paths. To set this for all your git repositories use ` git config --system core.longpaths true` (you probably need an administrative shell for this) or for just this one repository use ` git config core.longpaths true` .
135
-
136
- In addition make sure ` haskell-language-server.exe` is not running by closing your editor, otherwise in case of an upgrade the executable can not be installed.
137
-
138
- # ## Download the source code
139
-
140
- ` ` ` bash
141
- git clone https://github.com/haskell/haskell-language-server --recurse-submodules
142
- cd haskell-language-server
143
- ` ` `
144
-
145
- # ## Building
146
-
147
- Note, on first invocation of the build script with stack, a GHC is being installed for execution.
148
- The GHC used for the `install.hs` can be adjusted in ` ./install/stack.yaml` by using a different resolver.
149
-
150
- Available commands can be seen with:
151
-
152
- ` ` ` bash
153
- stack ./install.hs help
154
- ` ` `
155
-
156
- Remember, this will take time to download a Stackage-LTS and an appropriate GHC for build
157
- haskell-language-server the first time.
158
-
159
- # ## Install via cabal
160
-
161
- The install-script can be invoked via ` cabal` instead of ` stack` with the command
162
-
163
- ` ` ` bash
164
- cabal v2-run ./install.hs --project-file install/shake.project < target>
165
- ` ` `
166
-
167
- or using the existing alias script
168
-
169
- ` ` ` bash
170
- ./cabal-hls-install < target>
171
- ` ` `
172
-
173
- Running the script with cabal on windows requires a cabal version greater or equal to ` 3.0.0.0` .
174
-
175
- For brevity, only the ` stack` -based commands are presented in the following sections.
176
-
177
- # ## Install specific GHC Version
178
-
179
- The script will install the executables ` haskell-language-server-wrapper` and ` haskell-language-server` .
180
-
181
- It will copy the latter appending the used ghc version, needed by the wrapper to choose the suitable version
182
- for the project at hand.
183
-
184
- So installing the executables directly with ` stack install` or ` cabal v2-install` may not be enough
185
- for it to work properly.
186
-
187
- Install haskell-language-server for the latest available and supported GHC version (and hoogle docs):
188
-
189
- ` ` ` bash
190
- stack ./install.hs hls
191
- ` ` `
192
-
193
- Install haskell-language-server for a specific GHC version (and hoogle docs):
194
-
195
- ` ` ` bash
196
- stack ./install.hs hls-8.10.7
197
- ` ` `
198
-
199
- ` hls-8.10.7` target will build the project and install ` haskell-language-server-wrapper` ,
200
- ` haskell-language-server` and ` haskell-language-server-8.10.7` executables.
201
-
202
- The Haskell Language Server can also be built with ` cabal v2-build` instead of ` stack build` .
203
- This has the advantage that you can decide how the GHC versions have been installed.
204
- To see what GHC versions are available, the command ` cabal-hls-install ghcs` can be used.
205
- It will list all * supported* GHC versions that are on the path for build with their respective installation directory.
206
- If you think, this list is incomplete, you can try to modify the PATH variable, such that the executables can be found.
207
- Note, that the targets ` hls` and ` data` depend on the found GHC versions.
208
-
209
- An example output is:
210
-
211
- ` ` ` bash
212
- > ./cabal-hls-install ghcs
213
- ******************************************************************
214
- Found the following GHC paths:
215
- ghc-8.6.5: /opt/bin/ghc-8.6.5
216
- ghc-8.8.4: /opt/bin/ghc-8.8.4
217
-
218
- ******************************************************************
219
- ` ` `
220
-
221
- If your desired ghc has been found, you use it to install haskell-language-server.
222
-
223
- ` ` ` bash
224
- ./cabal-hls-install hls-8.6.5
225
- ` ` `
226
-
227
96
# # Installation from Hackage
228
97
229
98
Direct installation from Hackage, while possible via ` cabal install haskell-language-server` , is not recommended for most people.
0 commit comments