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
+32-23Lines changed: 32 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,37 +1,42 @@
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
4
4
-
__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.
5
+
**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.
5
6
6
7
## Requirements
8
+
7
9
The language client requires you to manually install the [HIE](https://github.com/haskell/haskell-ide-engine) language server,
Alternatively you can just `stack install`, but `make build` will give you the best setup.
15
17
16
18
## Features
19
+
17
20
Language server client for haskell using the [HIE](https://github.com/haskell/haskell-ide-engine) language server. Supports,
18
21
19
-
- Diagnostics via HLint and GHC warnings/errors
20
-
- Code actions and quick-fixes via [`apply-refact`](https://github.com/mpickering/apply-refact) (click the lightbulb)
21
-
- Type information and documentation (via hoogle) on hover
22
-
- Jump to definition (`F12` or `Go to Definition` in command palette)
23
-
- List all top level definitions
24
-
- Highlight references in document
25
-
- Completion
26
-
- Formatting via [`brittany`](https://github.com/lspitzner/brittany) (`^ ⌥ B` or `Format Document` in command palette)
27
-
- Renaming via [`HaRe`](https://github.com/alanz/HaRe) (`F2` or `Rename Symbol` in command palette)
28
-
-[Multi-root workspace](https://code.visualstudio.com/docs/editor/multi-root-workspaces) support
22
+
* Diagnostics via HLint and GHC warnings/errors
23
+
* Code actions and quick-fixes via [`apply-refact`](https://github.com/mpickering/apply-refact) (click the lightbulb)
24
+
* Type information and documentation (via hoogle) on hover
25
+
* Jump to definition (`F12` or `Go to Definition` in command palette)
26
+
* List all top level definitions
27
+
* Highlight references in document
28
+
* Completion
29
+
* Formatting via [`brittany`](https://github.com/lspitzner/brittany) (`^ ⌥ B` or `Format Document` in command palette)
30
+
* Renaming via [`HaRe`](https://github.com/alanz/HaRe) (`F2` or `Rename Symbol` in command palette)
31
+
*[Multi-root workspace](https://code.visualstudio.com/docs/editor/multi-root-workspaces) support
29
32
30
33
Additionally the language server itself features,
31
-
- Supports plain GHC projects, cabal projects (sandboxed and non sandboxed) and stack projects
32
-
- Fast due to caching of compile info
34
+
35
+
* Supports plain GHC projects, cabal projects (sandboxed and non sandboxed) and stack projects
36
+
* Fast due to caching of compile info
33
37
34
38
## Extension Settings
39
+
35
40
You can disable HLint and also control the maximum number of reported problems,
36
41
37
42
```json
@@ -60,8 +65,8 @@ If you need more control, and want to have a custom wrapper, either in your spec
60
65
61
66
There are a few placeholders which will be expanded:
62
67
63
-
-`~`, `${HOME}` and `${home}` will be expanded into your users' home folder.
64
-
-`${workspaceFolder}` and `${workspaceRoot}` will expand into your current project root.
68
+
*`~`, `${HOME}` and `${home}` will be expanded into your users' home folder.
69
+
*`${workspaceFolder}` and `${workspaceRoot}` will expand into your current project root.
65
70
66
71
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`.
67
72
@@ -84,6 +89,7 @@ If you `hie` executable is not on your path, you can manually set it,
84
89
The path placeholders work here as well. Note that this adds the `--lsp` argument to the call of this executable.
85
90
86
91
## Docs on Hover/Generating Hoogle DB
92
+
87
93
For the most current documentation on this, see [Docs on Hover/Completion](https://github.com/haskell/haskell-ide-engine#docs-on-hovercompletion).
88
94
89
95
HIE supports fetching docs from haddock on hover. It will fallback on using a hoogle db(generally located in ~/.hoogle on linux)
@@ -110,6 +116,7 @@ $ stack --stack-yaml=<stack.yaml you used to build hie> exec hoogle generate
110
116
```
111
117
112
118
## Manual Installation
119
+
113
120
Either install the extension via the marketplace (preferred), or if you are testing an unreleased version by,
114
121
115
122
```bash
@@ -127,35 +134,37 @@ In VS Code, open the extensions tab, and click on the `...` at the top right of
127
134
and use the `Install from VSIX...` option to locate and install the generated file.
128
135
129
136
## Using multi-root workspaces
137
+
130
138
First, check out [what multi-root workspaces](https://code.visualstudio.com/docs/editor/multi-root-workspaces) are. The idea of using multi-root workspaces, is to be able to work on several different Haskell projects, where the GHC version or stackage LTS could differ, and have it work smoothly.
131
139
132
140
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.
133
141
134
142
To showcase the utility of this, let's imagine that we are writing a full-stack Haskell website, and we have three main components:
135
143
136
-
- a backend using LTS 10.10 and
137
-
- a frontend using GHCJS and LTS 8.11,
138
-
- a common part that is shared between the two, using LTS 8.11.
144
+
* a backend using LTS 10.10 and
145
+
* a frontend using GHCJS and LTS 8.11,
146
+
* a common part that is shared between the two, using LTS 8.11.
139
147
140
148
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.
141
149
142
150
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,
152
160
153
161
```json
154
162
{
155
-
"languageServerHaskell.useHieWrapper": false
163
+
"languageServerHaskell.useHieWrapper": false
156
164
}
157
165
```
158
-
This provides a very flexible way of customizing your setup.
166
+
167
+
This provides a very flexible way of customizing your setup.
0 commit comments