Skip to content

Commit 76b4a3c

Browse files
authored
Merge pull request #227 from jneira/update-readme
Adapt README to the new extension settings
2 parents 380d70e + 5070aeb commit 76b4a3c

File tree

1 file changed

+34
-90
lines changed

1 file changed

+34
-90
lines changed

README.md

Lines changed: 34 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,17 @@
11
# Haskell Language Server Client
22

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.
45

56
**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.
67

78
## Requirements
89

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:
1011

11-
* using stack:
12-
13-
```bash
14-
$ git clone https://github.com/haskell/haskell-ide-engine --recursive
15-
$ cd haskell-ide-engine && ./install.hs hie
16-
```
17-
18-
* using cabal:
19-
20-
```bash
21-
$ git clone https://github.com/haskell/haskell-ide-engine --recursive
22-
$ 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.
4215

4316
## Features
4417

@@ -57,12 +30,14 @@ Language server client for haskell using the [HIE](https://github.com/haskell/ha
5730

5831
Additionally the language server itself features,
5932

60-
* Supports plain GHC projects, cabal projects (sandboxed and non sandboxed) and stack projects
33+
* Supports plain GHC projects, cabal projects and stack projects
6134
* Fast due to caching of compile info
6235

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+
6338
## Supported GHC versions
6439

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.
6641

6742
## Extension Settings
6843

@@ -76,52 +51,45 @@ You can disable HLint and also control the maximum number of reported problems,
7651
If the liquid haskell executable is installed, enable using it to
7752
process haskell files on save.
7853

79-
```
54+
```json
8055
"languageServerHaskell.liquidOn": true,
8156
```
8257

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,
95-
96-
```json
97-
"languageServerHaskell.useCustomHieWrapper": true,
98-
"languageServerHaskell.useCustomHieWrapperPath": "~/wrapper-in-home.sh",
99-
```
58+
### HIE Variant
10059

101-
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.
10264

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:
10568

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`.
10772

108-
#### Enable/disable HIE
73+
### Enable/disable HIE
10974

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.
11176

11277
```json
11378
"languageServerHaskell.enableHIE": true
11479
```
11580

116-
#### Path for hie executable
81+
### Path for hie executable
11782

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,
11984

12085
```json
12186
"languageServerHaskell.hieExecutablePath": "~/.local/bin/hie"
12287
```
12388

124-
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.
12593

12694
## Docs on Hover/Generating Hoogle DB
12795

@@ -139,7 +107,7 @@ $ stack haddock --keep-going
139107

140108
To enable documentation generation for cabal projects, add the following to your ~/.cabal/config
141109

142-
```
110+
```json
143111
documentation: True
144112
```
145113

@@ -150,6 +118,9 @@ $ cd haskell-ide-engine
150118
$ stack --stack-yaml=<stack.yaml you used to build hie> exec hoogle generate
151119
```
152120

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+
153124
## Manual Installation
154125

155126
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
174145

175146
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.
176147

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,
186-
187-
```json
188-
{
189-
"languageServerHaskell.useCustomHieWrapper": true,
190-
"languageServerHaskell.useCustomHieWrapperPath": "${workspaceFolder}/hie.sh"
191-
}
192-
```
193-
194-
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-
204148
## Investigating and reporting problems
205149

206150
1. Go to extensions and right click `Haskell Language Server` and choose `Configure Extensions Settings`

0 commit comments

Comments
 (0)