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
+46-49Lines changed: 46 additions & 49 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,89 +1,73 @@
1
-
# Haskell Language Server Client
1
+
# Haskell for Visual Studio Code
2
2
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.
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.
7
-
8
-
## Requirements
9
-
10
-
The language client requires you to manually install at least one of:
11
-
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.
3
+
This is the Visual Studio Code extension for the [Haskell programming language](https://haskell.org), powered by the [Haskell Langauge Server](https://github.com/haskell/haskell-language-server).
15
4
16
5
## Features
17
6
18
-
Language server client for haskell using the [HIE](https://github.com/haskell/haskell-ide-engine) language server. Supports,
19
-
20
-
- Diagnostics via HLint and GHC warnings/errors
7
+
- Warning and error diagnostics
21
8
- Code actions and quick-fixes via [`apply-refact`](https://github.com/mpickering/apply-refact) (click the lightbulb)
22
-
- Type information and documentation (via hoogle) on hover
23
-
- Jump to definition (`F12` or `Go to Definition` in command palette)
9
+
- Type information and documentation on hover
10
+
- Jump to definition (`F12` or `Go to Definition` in the command palette)
24
11
- List all top level definitions
25
12
- Highlight references in document
26
-
-Completion
13
+
-Code completion
27
14
- Formatting via [`brittany`](https://github.com/lspitzner/brittany) (`^ ⌥ B` or `Format Document` in command palette)
28
-
- Renaming via [`HaRe`](https://github.com/alanz/HaRe) (`F2` or `Rename Symbol` in command palette)
29
15
-[Multi-root workspace](https://code.visualstudio.com/docs/editor/multi-root-workspaces) support
30
16
31
-
Additionally the language server itself features,
32
-
33
-
- Supports plain GHC projects, cabal projects and stack projects
34
-
- Fast due to caching of compile info
17
+
## Requirements
35
18
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.
19
+
- For standalone `.hs`/`.lhs` files, [ghc](https://www.haskell.org/ghc/) must be installed and on the PATH. The easiest way to install it is with [ghcup](https://www.haskell.org/ghcup/).
20
+
- For Cabal based projects, [cabal-install](https://www.haskell.org/cabal/) must be installed and on the PATH. It can also be installed with [ghcup](https://www.haskell.org/ghcup/).
21
+
- For Stack based projects, [stack](http://haskellstack.org) must be installed and on the PATH.
37
22
38
23
## Supported GHC versions
39
24
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.
25
+
| GHC | Linux | macOS | Windows |
26
+
| ------ | ----- | ----- | ------- |
27
+
| 8.10.1 | ✓ | ✓ | ✓ |
28
+
| 8.8.3 | ✓ | ✓ |
29
+
| 8.8.2 | ✓ | ✓ |
30
+
| 8.6.5 | ✓ | ✓ | ✓ |
31
+
| 8.6.4 | ✓ | ✓ | ✓ |
32
+
33
+
## Language Servers
34
+
35
+
This extension also supports several other language servers for Haskell, some which need to be manually installed:
36
+
37
+
-[Haskell Language Server](https://github.com/haskell/haskell-language-server#installation): This is the default language server which will automatically be downloaded, so no installation should be needed. It builds upon ghcide by providing extra plugins and features.
38
+
-[ghcide](https://github.com/digital-asset/ghcide#install-ghcide): A fast and reliable LSP server with support for [basic features](https://github.com/digital-asset/ghcide#features).
39
+
-[Haskell IDE Engine](https://github.com/haskell/haskell-ide-engine#installation): A stable and mature language server, but note that development has moved from this to the Haskell Language Server.
41
40
42
41
## Extension Settings
43
42
44
43
You can disable HLint and also control the maximum number of reported problems,
45
44
46
45
```json
47
-
"languageServerHaskell.hlintOn": true,
48
-
"languageServerHaskell.maxNumberOfProblems": 100,
46
+
"haskell.hlintOn": true,
47
+
"haskell.maxNumberOfProblems": 100,
49
48
```
50
49
51
50
If the liquid haskell executable is installed, enable using it to
52
51
process haskell files on save.
53
52
54
53
```json
55
-
"languageServerHaskell.liquidOn": true,
54
+
"haskell.liquidOn": true,
56
55
```
57
56
58
-
### HIE Variant
59
-
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.
64
-
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:
68
-
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`.
72
-
73
-
### Enable/disable HIE
57
+
### Enable/disable server
74
58
75
59
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.
76
60
77
61
```json
78
-
"languageServerHaskell.enableHIE": true
62
+
"haskell.enable": true
79
63
```
80
64
81
-
### Path for hie executable
65
+
### Path to server executable executable
82
66
83
-
If your chosen haskell language server executable is not on your path, you can manually set it,
67
+
If your server is manually installed and not on your path, you can also manually set the path to the executable.
There are a few placeholders which will be expanded:
@@ -145,6 +129,16 @@ First, check out [what multi-root workspaces](https://code.visualstudio.com/docs
145
129
146
130
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.
147
131
132
+
## Downloaded language servers
133
+
134
+
This extension will download the language server binaries to a specific location depending on your system. If you find yourself running out of disk space, you can try deleting old versions of language servers in this directory. The extension will redownload them, no strings attached.
| Windows |`%APPDATA%\Code\User\globalStorage\alanz.vscode-hie-server`|
139
+
| Linux | TODO |
140
+
141
+
148
142
## Investigating and reporting problems
149
143
150
144
1. Go to extensions and right click `Haskell Language Server` and choose `Configure Extensions Settings`
@@ -164,6 +158,9 @@ Now you will see the information which you can use to diagnose or report a probl
164
158
**Common issues*:
165
159
* For now, the extension is not able to open a single haskell source file. You need to open a workspace or folder, configured to be built with cabal, stack or other hie-bios compatible program.
166
160
* Check you don't have other haskell extensions active, they can interfere with each other.
161
+
## Contributing
162
+
163
+
If you want to help, get started by reading [Contributing](https://github.com/alanz/vscode-hie-server/blob/master/Contributing.md) for more details.
0 commit comments