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
This extension adds language support for [Haskell](https://haskell.org), powered by the [Haskell Language Server](https://github.com/haskell/haskell-language-server).
6
6
@@ -12,27 +12,37 @@ This extension adds language support for [Haskell](https://haskell.org), powered
12
12
- Document symbols
13
13
- Highlight references in document
14
14
- Code completion
15
-
- Formatting via Brittany, Floskell, Ormolu or Stylish Haskell
15
+
- Formatting via Brittany, Floskell, Fourmolu, Ormolu or Stylish Haskell
16
16
-[Multi-root workspace](https://code.visualstudio.com/docs/editor/multi-root-workspaces) support
17
17
- Code evaluation (Haskell Language Server), see ([Tutorial](https://github.com/haskell/haskell-language-server/blob/master/plugins/hls-eval-plugin/README.md))
- Integration with [retrie](https://hackage.haskell.org/package/retrie)
22
22
23
-
- 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/) or [Chocolatey](https://www.haskell.org/platform/windows.html) on Windows.
24
-
- For Cabal based projects, both ghc and [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/) or [Chocolatey](https://www.haskell.org/platform/windows.html) on Windows.
25
-
- For Stack based projects, [stack](http://haskellstack.org) must be installed and on the PATH.
- Generate functions from type signatures, and intelligently complete holes using [Wingman (tactics)](https://github.com/haskell/haskell-language-server/tree/master/plugins/hls-tactics-plugin)
28
30
29
-
Whilst this extension is powered by the Haskell Language Server by default, it also supports several others which can be manually installed:
-[Haskell Language Server](https://github.com/haskell/haskell-language-server#installation): This is the default language server which will automatically be downloaded, so it does not need manual installation. It builds upon ghcide by providing extra plugins and features.
32
-
-[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).
33
-
-[Haskell IDE Engine](https://github.com/haskell/haskell-ide-engine#installation): A legacy language server, you probably shouldn't use this one. Haskell Language Server replaces it instead.
33
+
- Integration with [hlint](https://github.com/ndmitchell/hlint) to show diagnostics and apply hints via [apply-refact](https://github.com/mpickering/apply-refact)
34
34
35
-
You can choose which language server to use from the "Haskell > Language Server Variant" configuration option.
- Module name suggestions for insertion or correction
38
+
39
+

40
+
41
+
## Requirements
42
+
43
+
- 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/) or [Chocolatey](https://www.haskell.org/platform/windows.html) on Windows.
44
+
- For Cabal based projects, both ghc and [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/) or [Chocolatey](https://www.haskell.org/platform/windows.html) on Windows.
45
+
- For Stack based projects, [stack](http://haskellstack.org) must be installed and on the PATH.
36
46
37
47
## Configuration options
38
48
@@ -49,8 +59,6 @@ There are a few placeholders which will be expanded:
49
59
-`~`, `${HOME}` and `${home}` will be expanded into your users' home folder.
50
60
-`${workspaceFolder}` and `${workspaceRoot}` will expand into your current project root.
51
61
52
-
## Haskell Language Server specifics
53
-
54
62
### Local documentation
55
63
56
64
Haskell Language Server can display Haddock documentation on hover and completions if the project and
@@ -59,19 +67,23 @@ its dependencies have been built with the `-haddock` GHC flag.
59
67
- For cabal:
60
68
61
69
- Add to your global config file (e.g. `~/.cabal/config`):
62
-
```
70
+
71
+
```yaml
63
72
program-default-options
64
73
ghc-options: -haddock
65
74
```
75
+
66
76
- Or, for a single project, run `cabal configure --ghc-options=-haddock`
67
77
68
78
- For stack, add to global `$STACK_ROOT\config.yaml`, or project's `stack.yaml`:
69
-
```
79
+
80
+
```yaml
70
81
ghc-options:
71
-
"$everything": -haddock
82
+
'$everything': -haddock
72
83
```
84
+
73
85
Note that this flag will cause compilation errors if a dependency contains invalid Haddock markup,
74
-
until GHC 8.12 which [will report warnings](https://gitlab.haskell.org/ghc/ghc/-/merge_requests/2377)
86
+
until GHC 9.0 which [will report warnings](https://gitlab.haskell.org/ghc/ghc/-/merge_requests/2377)
75
87
instead.
76
88
77
89
### Downloaded binaries
@@ -101,7 +113,7 @@ These are the versions of GHC that there are binaries of `haskell-language-serve
101
113
| 8.6.5 | ✓ | ✓ | ✓ |
102
114
| 8.6.4 | ✓ | ✓ | ✓ |
103
115
104
-
The exact list of binaries can be checked in the last release of haskell-language-server: https://github.com/haskell/haskell-language-server/releases/latest
116
+
The exact list of binaries can be checked in the last release of haskell-language-server: <https://github.com/haskell/haskell-language-server/releases/latest>
105
117
106
118
## Using multi-root workspaces
107
119
@@ -111,25 +123,19 @@ The language server is now started for each workspace folder you have in your mu
111
123
112
124
## Investigating and reporting problems
113
125
114
-
1. Go to extensions and right click `Haskell Language Server` and choose `Extensions Settings`
115
-
2. Scroll down to `Language Server Haskell › Trace: Server` and set it to `messages`
116
-
3. Restart vscode and reproduce your problem
117
-
4. Go to the main menu and choose `View -> Output` (`Ctrl + Shift + U`)
118
-
5. On the new Output panel that opens on the right side in the drop down menu choose `Haskell (<your project>)`
126
+
1. Go to extensions and right click `Haskell Language Server` and choose `Extensions Settings`
127
+
2. Scroll down to `Language Server Haskell › Trace: Server` and set it to `messages`
128
+
3. Restart vscode and reproduce your problem
129
+
4. Go to the main menu and choose `View -> Output` (`Ctrl + Shift + U`)
130
+
5. On the new Output panel that opens on the right side in the drop down menu choose `Haskell (<your project>)`
119
131
120
-
Please include the output when filing any issues on the relevant languageserver's issue tracker.
132
+
Please include the output when filing any issues on the [haskell-language-server](https://github.com/haskell/haskell-language-server/issues/new) issue tracker.
121
133
122
134
### Troubleshooting
123
135
124
136
- Sometimes the language server might get stuck in a rut and stop responding to your latest changes.
125
137
Should this occur you can try restarting the language server with <kbd>Ctrl</kbd> <kbd>shift</kbd> <kbd>P</kbd>/<kbd>⌘</kbd> <kbd>shift</kbd> <kbd>P</kbd> > Restart Haskell LSP Server.
126
-
- Usually the error or unexpected behaviour is already reported in the haskell language server [used by the extension](#hie-variant). Finding the issue in its issue tracker could be useful to help resolve it. Sometimes even it includes a workaround for the issue.
- 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.
132
-
- Check you don't have other haskell extensions active, they can interfere with each other.
138
+
- Usually the error or unexpected behaviour is already reported in the [haskell language server issue tracker](https://github.com/haskell/haskell-language-server/issues). Finding the issue could be useful to help resolve it and sometimes includes a workaround for the issue.
0 commit comments