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: README.md
+34-90Lines changed: 34 additions & 90 deletions
Original file line number
Diff line number
Diff line change
@@ -1,44 +1,17 @@
1
1
# Haskell Language Server Client
2
2
3
-
Client interface to the Language Server Protocol server for Haskell, as provided by the Haskell IDE Engine. Check the [requirements](#user-content-requirements) for dependencies.
3
+
Client interface to the Language Server Protocol server for Haskell, as provided by the [Haskell IDE Engine](https://github.com/haskell/haskell-ide-engine), [ghcide](https://github.com/digital-asset/ghcide) or the new [Haskell Language Server](https://github.com/haskell/haskell-language-server).
4
+
Check the [requirements](#user-content-requirements) for dependencies.
4
5
5
6
**It is still under development!** If you want to help, get started by reading [Contributing](https://github.com/alanz/vscode-hie-server/blob/master/Contributing.md) for more details.
6
7
7
8
## Requirements
8
9
9
-
The language client requires you to manually install the [HIE](https://github.com/haskell/haskell-ide-engine) language server which can be done with commands below but this will take exceedingly long time and less than robust, consider proceeding to installation readme at the link below, it has option for getting bins directly:
10
+
The language client requires you to manually install at least one of:
$ cd haskell-ide-engine && ./cabal-hie-install hie
23
-
```
24
-
25
-
On Windows, it is advised to either install HIE at the root of the drive, and/or to enable [Win32 Long paths](https://github.com/haskell/haskell-ide-engine#windows-specific-pre-requirements):
26
-
27
-
* using stack:
28
-
29
-
```cmd
30
-
C:\> git clone https://github.com/haskell/haskell-ide-engine --recursive hie
31
-
C:\> cd hie && stack .\install.hs hie
32
-
```
33
-
34
-
* using cabal:
35
-
36
-
```cmd
37
-
C:\> git clone https://github.com/haskell/haskell-ide-engine --recursive hie
38
-
C:\> cd hie && .\cabal-hie-install hie
39
-
```
40
-
41
-
If you experience difficulties, use the instructions at https://github.com/haskell/haskell-ide-engine#installation
12
+
*[Haskell IDE Engine](https://github.com/haskell/haskell-ide-engine#installation): It was the unique haskell LSP server supported by this extension until version `0.40.0`. It is stable and functional but it will be replaced sooner or later by the new Haskell Language Server (see below).
13
+
*[ghcide](https://github.com/digital-asset/ghcide#install-ghcide): A fast and reliable LSP server with the [main basic features](https://github.com/digital-asset/ghcide#features). Supported since the `0.40.0` version of the extension.
14
+
*[Haskell language server](https://github.com/haskell/haskell-language-server#installation): The future successor of haskell-ide-engine. It is still under heavy development and it does not have all the features of haskell-ide-engine, yet, so use at your own risk! It is supported since the `0.40.0` version of the extension.
42
15
43
16
## Features
44
17
@@ -57,12 +30,14 @@ Language server client for haskell using the [HIE](https://github.com/haskell/ha
57
30
58
31
Additionally the language server itself features,
59
32
60
-
* Supports plain GHC projects, cabal projects (sandboxed and non sandboxed) and stack projects
33
+
* Supports plain GHC projects, cabal projects and stack projects
61
34
* Fast due to caching of compile info
62
35
36
+
The other two language servers ([ghcide](https://github.com/digital-asset/ghcide#features) and haskell-language-server) have a subset of the features described above.
37
+
63
38
## Supported GHC versions
64
39
65
-
vscode-hie-server depends on haskell-ide-engine to support different versions of GHC. At the moment of writing the following versions are supported: 8.4, 8.6 and 8.8. If your project uses any other GHC version it won't work.
40
+
vscode-hie-server depends on the chosen haskell language server to support different versions of GHC. At the moment of writing the following versions are supported using Haskell Ide Engine: 8.4, 8.6 and 8.8. ghcide and Haskell Language Server also have support for ghc 8.10. If your project uses any other GHC version it won't work.
66
41
67
42
## Extension Settings
68
43
@@ -76,52 +51,45 @@ You can disable HLint and also control the maximum number of reported problems,
76
51
If the liquid haskell executable is installed, enable using it to
77
52
process haskell files on save.
78
53
79
-
```
54
+
```json
80
55
"languageServerHaskell.liquidOn": true,
81
56
```
82
57
83
-
#### HIE Wrapper
84
-
85
-
Furthermore, the extension supports multiple ways of initializing hie, depending on your needs.
86
-
The default one uses the `hie-vscode.[sh|bat]` file to start hie through.
87
-
This will attempt to start via `hie-wrapper` if it is on the vscode path, otherwise fall back to `hie`.
88
-
The`hie-wrapper` executable is installed using `stack ./install.hs hie` or `./cabal-hie-install hie`,
89
-
together with the other GHC version specific `hie-8.x` executables.
90
-
This will take precedence over `hieExecutablePath`.
91
-
92
-
#### Custom Wrapper
93
-
94
-
If you need more control, and want to have a custom wrapper, either in your specific project or somewhere else on your computer, you can set a custom wrapper via,
There are a few placeholders which will be expanded:
60
+
Since `0.40` the extension has a selection over the three supported language servers:
61
+
`haskell-ide-engine`, `ghcide` and `haskell-language-server`.
62
+
The default one is `haskell-ide-engine`, although it will be changed by `haskell-language-server`
63
+
when it will be stable enough.
102
64
103
-
*`~`, `${HOME}` and `${home}` will be expanded into your users' home folder.
104
-
*`${workspaceFolder}` and `${workspaceRoot}` will expand into your current project root.
65
+
The extension will look for the language server executable in `$PATH` and it will call it
66
+
with the appropiate params depending on the extension settings.
67
+
However, not all extension settings can be applied to all the language servers:
105
68
106
-
This can be beneficial if you are using something like nix, to have a wrapper script tailored to your setup. This will take precedence over `useHieWrapper` and `hieExecutablePath`.
69
+
*`haskell-ide-engine`: It supports all of them.
70
+
*`ghcide`: It does not support any of them.
71
+
*`haskell-language-server`: For now it only supports the log related settings: `Log File` and `Trace:server`. The goal is to support the same settings as `haskell-ide-engine`.
107
72
108
-
####Enable/disable HIE
73
+
### Enable/disable HIE
109
74
110
-
You can enable or disable HIE via configuration. This is useful, because multi-root workspaces do not yet allow you to manage extensions at the folder level, which can be necessary.
75
+
You can enable or disable the chosen haskell language server via configuration. This is sometimes useful at workspace level, because multi-root workspaces do not yet allow you to manage extensions at the folder level, which can be necessary.
111
76
112
77
```json
113
78
"languageServerHaskell.enableHIE": true
114
79
```
115
80
116
-
####Path for hie executable
81
+
### Path for hie executable
117
82
118
-
If you `hie` executable is not on your path, you can manually set it,
83
+
If your chosen haskell language server executable is not on your path, you can manually set it,
The path placeholders work here as well. Note that this adds the `--lsp` argument to the call of this executable.
89
+
There are a few placeholders which will be expanded:
90
+
91
+
*`~`, `${HOME}` and `${home}` will be expanded into your users' home folder.
92
+
*`${workspaceFolder}` and `${workspaceRoot}` will expand into your current project root.
125
93
126
94
## Docs on Hover/Generating Hoogle DB
127
95
@@ -139,7 +107,7 @@ $ stack haddock --keep-going
139
107
140
108
To enable documentation generation for cabal projects, add the following to your ~/.cabal/config
141
109
142
-
```
110
+
```json
143
111
documentation: True
144
112
```
145
113
@@ -150,6 +118,9 @@ $ cd haskell-ide-engine
150
118
$ stack --stack-yaml=<stack.yaml you used to build hie>exec hoogle generate
151
119
```
152
120
121
+
For now `ghcide`and `haskell-language-server` have not that fallback to the hoogle database, so
122
+
you should generate haddock documentation as described above.
123
+
153
124
## Manual Installation
154
125
155
126
Either install the extension via the marketplace (preferred), or if you are testing an unreleased version by,
@@ -174,33 +145,6 @@ First, check out [what multi-root workspaces](https://code.visualstudio.com/docs
174
145
175
146
HIE is now started for each workspace folder you have in your multi-root workspace, and several configurations are on a resource (i.e. folder) scope, instead of window (i.e. global) scope.
176
147
177
-
To showcase the utility of this, let's imagine that we are writing a full-stack Haskell website, and we have three main components:
178
-
179
-
* a backend using LTS 10.10 and
180
-
* a frontend using GHCJS and LTS 8.11,
181
-
* a common part that is shared between the two, using LTS 8.11.
182
-
183
-
One way to be able to work on all these in the same VSCode project is to create a new workspace, and then add each folder to the workspace. This way, they are considered separate entities, and HIE will start separately for each.
184
-
185
-
You can then define how to start HIE for each of these folders, by going into `Settings` and then choosing `Folder Settings -> <the folder you want>`, or just configure the workspace. E.g. the _backend_ and _common_ projects could have a folder settting,
to launch HIE via `hie.sh` inside the _backend_ and _common_ folder, while the _frontend_, because of using GHCJS, might not want to use HIE, and therefore needs to disable HIE,
195
-
196
-
```json
197
-
{
198
-
"languageServerHaskell.useHieWrapper": false
199
-
}
200
-
```
201
-
202
-
This provides a very flexible way of customizing your setup.
203
-
204
148
## Investigating and reporting problems
205
149
206
150
1. Go to extensions and right click `Haskell Language Server` and choose `Configure Extensions Settings`
0 commit comments