|
1 | 1 | # Features
|
2 | 2 |
|
3 |
| -You can watch demos for some of these features [below](#demos). |
4 |
| - |
5 |
| -- Warning and error diagnostics from GHC |
6 |
| -- Type information and documentation on hover, [including your own comments](./configuration.md#how-to-show-local-documentation-on-hover). |
7 |
| -- Jump to definition: [for now only for local code definitions](https://github.com/haskell/haskell-language-server/issues/708) |
8 |
| -- Document symbols |
9 |
| -- Highlight references in document |
10 |
| -- Code completion |
11 |
| -- Formatting via [Brittany](https://github.com/lspitzner/brittany), [Floskell](https://github.com/ennocramer/floskell), [Fourmolu](https://github.com/fourmolu/fourmolu), [Ormolu](https://github.com/tweag/ormolu) or [Stylish Haskell](https://github.com/haskell/stylish-haskell) |
12 |
| -- [Code evaluation](#code-evaluation), see its [Tutorial](https://github.com/haskell/haskell-language-server/blob/master/plugins/hls-eval-plugin/README.md) |
13 |
| -- [Integration with](#retrie-integration) [retrie](https://hackage.haskell.org/package/retrie), a powerful, easy-to-use codemodding tool |
14 |
| -- [Code lenses for explicit import lists](#explicit-import-lists) |
15 |
| -- [Generate functions from type signatures, and intelligently complete holes](#wingman) using [Wingman (tactics)](https://github.com/haskell/haskell-language-server/tree/master/plugins/hls-tactics-plugin) |
16 |
| -- [Integration](#hlint) with [hlint](https://github.com/ndmitchell/hlint), the most used haskell linter, to show diagnostics and apply hints via [apply-refact](https://github.com/mpickering/apply-refact) |
17 |
| -- [Module name suggestions](#module-names) for insertion or correction |
18 |
| -- [Call hierarchy support](#call-hierarchy) |
19 |
| -- [Qualify names from an import declaration](#qualify-imported-names) in your code |
20 |
| -- [Suggest alternate numeric formats](#alternate-number-formatting) |
21 |
| - |
22 |
| -## Demos |
23 |
| - |
24 |
| -### Code evaluation |
| 3 | +This table gives a summary of the features that HLS supports. |
| 4 | +Many of these are standard LSP features, but a lot of special features are provided as [code actions](#code-actions) and [code lenses](#code-lenses). |
25 | 5 |
|
26 |
| - |
| 6 | +| Feature | Status | [LSP method](./what-is-hls.md#lsp-terminology) | |
| 7 | +|-----------------------------------------------------|---------------------------------|---------------------------------------------------------------------------------------------------| |
| 8 | +| [Diagnostics](#diagnostics) | Limited on some versions of GHC | `textDocument/publishDiagnostics` | |
| 9 | +| [Hovers](#hovers) | Working | `textDocument/hover` | |
| 10 | +| [Jump to definition](#jump-to-definition) | Working | `textDocument/definition` | |
| 11 | +| [Jump to type definition](#jump-to-type-definition) | Working | `textDocument/typeDefinition` | |
| 12 | +| [Find references](#find-references) | Working | `textDocument/references` | |
| 13 | +| [Completions](#completions) | Working | `textDocument/completion` | |
| 14 | +| [Formatting](#formatting) | Limited on some versions of GHC | `textDocument/formatting`, `textDocument/rangeFormatting` | |
| 15 | +| [Document symbols](#document-symbols) | Working | `textDocument/documentSymbol` | |
| 16 | +| [Workspace symbols](#workspace-symbols) | Working | `workspace/symbol` | |
| 17 | +| [Call hierarchy](#call-hierarchy) | Working | `textDocument/prepareCallHierarchy`, `callHierarchy/incomingCalls`, `callHierarchy/outgoingCalls` | |
| 18 | +| [Highlight references](#highlight-references) | Working | `textDocument/documentHighlight` | |
| 19 | +| [Code actions](#code-actions) | Limited on some versions of GHC | `textDocument/codeAction` | |
| 20 | +| [Code lenses](#code-lenses) | Limited on some versions of GHC | `textDocument/codeLens` | |
27 | 21 |
|
28 |
| -### Retrie integration |
| 22 | +The individual sections below also identify which [HLS plugin](./what-is-hls.md#hls-plugins) is responsible for providing the given functionality, which is useful if you want to raise an issue report or contribute! |
29 | 23 |
|
30 |
| - |
| 24 | +## Diagnostics |
31 | 25 |
|
32 |
| -### Explicit import lists |
| 26 | +### GHC compiler errors and warnings |
| 27 | +Provided by: `ghcide` |
33 | 28 |
|
34 |
| - |
| 29 | +Provides errors and warnings from GHC as diagnostics. |
35 | 30 |
|
36 |
| -### Wingman |
| 31 | +### Hlint hints |
| 32 | +Status: Not supported on GHC 9.2 |
37 | 33 |
|
38 |
| - |
| 34 | +Provided by: `hls-hlint-plugin` |
39 | 35 |
|
40 |
| -### Hlint |
| 36 | +Provides hlint hints as diagnostics. |
41 | 37 |
|
42 |
| - |
| 38 | +## Hovers |
| 39 | +Provided by: `ghcide` |
43 | 40 |
|
44 |
| -### Module names |
| 41 | +Type information and documentation on hover, [including from local definitions](./configuration.md#how-to-show-local-documentation-on-hover). |
45 | 42 |
|
46 |
| - |
| 43 | +## Jump to definition |
| 44 | +Provided by: `ghcide` |
| 45 | + |
| 46 | +Jump to definition, [for now only for local code definitions](https://github.com/haskell/haskell-language-server/issues/708). |
| 47 | + |
| 48 | +## Jump to type definition |
| 49 | +Provided by: `ghcide` |
| 50 | + |
| 51 | +## Find references |
| 52 | +Provided by: `ghcide` |
| 53 | + |
| 54 | +Find references to a name within the project. |
| 55 | + |
| 56 | +## Completions |
47 | 57 |
|
48 |
| -### Call hierarchy |
| 58 | +### Code completions |
| 59 | +Provided by: `ghcide` |
| 60 | + |
| 61 | +- Completion of names from qualified imports. |
| 62 | +- Completion of names from non-imported modules. |
| 63 | + |
| 64 | +### Pragma completions |
| 65 | +Provided by: `hls-pragmas-plugin` |
| 66 | + |
| 67 | +Completions for language pragmas. |
| 68 | + |
| 69 | +## Formatting |
| 70 | +Format your code with various Haskell code formatters. |
| 71 | + |
| 72 | +| Formatter | Status | Provided by | |
| 73 | +|-----------------|---------------------------------|------------------------------| |
| 74 | +| Brittany | Not supported on GHC 9.2 | `hls-brittany-plugin` | |
| 75 | +| Floskell | Working | `hls-floskell-plugin` | |
| 76 | +| Fourmolu | Working | `hls-fourmolu-plugin` | |
| 77 | +| Ormolu | Working | `hls-ormolu-plugin` | |
| 78 | +| Stylish Haskell | Not supported on GHC 9.0 or 9.2 | `hls-stylish-haskell-plugin` | |
| 79 | + |
| 80 | +## Document symbols |
| 81 | +Provided by: `ghcide` |
| 82 | + |
| 83 | +Provides listing of the symbols defined in a module, used to power outline displays. |
| 84 | + |
| 85 | +## Workspace symbols |
| 86 | +Provided by: `ghcide` |
| 87 | + |
| 88 | +Provides listing of the symbols defined in the project, used to power searches. |
| 89 | + |
| 90 | +## Call hierarchy |
| 91 | +Provided by: `hls-call-hierarchy-plugin` |
| 92 | + |
| 93 | +Shows ingoing and outgoing calls for a function. |
49 | 94 |
|
50 | 95 | 
|
51 | 96 |
|
| 97 | +## Highlight references |
| 98 | +Provided by: `ghcide` |
| 99 | + |
| 100 | +Highlights references to a name in a document. |
| 101 | + |
| 102 | +## Code actions |
| 103 | + |
| 104 | +### Insert missing pragmas |
| 105 | +Provided by: `hls-pragma-plugin` |
| 106 | + |
| 107 | +Code action kind: `quickfix` |
| 108 | + |
| 109 | +Inserts missing pragmas needed by GHC. |
| 110 | + |
| 111 | +### Apply Hlint fixes |
| 112 | +Status: Not supported on GHC 9.2 |
| 113 | + |
| 114 | +Provided by: `hls-hlint-plugin` |
| 115 | + |
| 116 | +Code action kind: `quickfix` |
| 117 | + |
| 118 | +Applies hints, either individually or for the whole file. |
| 119 | +Uses [apply-refact](https://github.com/mpickering/apply-refact). |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | +### Make import lists fully explicit |
| 124 | +Provided by: `hls-explicit-imports-plugin` |
| 125 | + |
| 126 | +Code action kind: `quickfix.literals.style` |
| 127 | + |
| 128 | +Make import lists fully explicit (same as the code lens). |
| 129 | + |
52 | 130 | ### Qualify imported names
|
| 131 | +Provided by: `hls-qualify-imported-names-plugin` |
| 132 | + |
| 133 | +Code action kind: `quickfix` |
| 134 | + |
| 135 | +Rewrites imported names to be qualified. |
53 | 136 |
|
54 | 137 | 
|
55 | 138 |
|
56 |
| -### Alternate Number Formatting |
| 139 | +### Refine import |
| 140 | +Provided by: `hls-refine-imports-plugin` |
| 141 | + |
| 142 | +Code action kind: `quickfix.import.refine` |
| 143 | + |
| 144 | +Refines imports to more specific modules when names are re-exported (same as the code lens). |
| 145 | + |
| 146 | +### Add missing class methods |
| 147 | +Status: Not supported on GHC 9.2 |
| 148 | + |
| 149 | +Provided by: `hls-class-plugin` |
| 150 | + |
| 151 | +Code action kind: `quickfix` |
| 152 | + |
| 153 | +Adds placeholders for missing class methods in a class instance definition. |
| 154 | + |
| 155 | +### Unfold definition |
| 156 | +Status: Not supported on GHC 9.2 |
| 157 | + |
| 158 | +Provided by: `hls-retrie-plugin` |
| 159 | + |
| 160 | +Code action kind: `refactor.extract` |
| 161 | + |
| 162 | +Extracts a definition from the code. |
| 163 | + |
| 164 | +### Fold definition |
| 165 | +Status: Not supported on GHC 9.2 |
| 166 | + |
| 167 | +Provided by: `hls-retrie-plugin` |
| 168 | + |
| 169 | +Code action kind: `refactor.inline` |
| 170 | + |
| 171 | +Inlines a definition from the code. |
| 172 | + |
| 173 | + |
| 174 | + |
| 175 | +### Insert contents of Template Haskell splice |
| 176 | +Status: Not supported on GHC 9.2 |
| 177 | + |
| 178 | +Provided by: `hls-splice-plugin` |
| 179 | + |
| 180 | +Code action kind: `refactor.rewrite` |
| 181 | + |
| 182 | +Evaluates a Template Haskell splice and inserts the resulting code in its place. |
| 183 | + |
| 184 | +### Convert numbers to alternative formats |
| 185 | +Status: Not supported on GHC 9.2 |
| 186 | + |
| 187 | +Provided by: `hls-alternate-number-format-plugin` |
| 188 | + |
| 189 | +Code action kind: `quickfix.literals.style` |
| 190 | + |
| 191 | +Converts numeric literals to different formats. |
57 | 192 |
|
58 | 193 | 
|
| 194 | + |
| 195 | +### Add Haddock comments |
| 196 | +Status: Not supported on GHC 9.2 |
| 197 | + |
| 198 | +Provided by: `hls-haddock-comments-plugin` |
| 199 | + |
| 200 | +Code action kind: `quickfix` |
| 201 | + |
| 202 | +Adds Haddock comments for function arguments. |
| 203 | + |
| 204 | +### Wingman |
| 205 | +Status: Not supported on GHC 9.2 |
| 206 | + |
| 207 | +Provided by: `hls-tactics-plugin` |
| 208 | + |
| 209 | +Provides a variety of code actions for interactive code development, see https://haskellwingman.dev/ for more details. |
| 210 | + |
| 211 | + |
| 212 | + |
| 213 | +## Code lenses |
| 214 | + |
| 215 | +### Add type signature |
| 216 | +Provided by: `ghcide` |
| 217 | + |
| 218 | +Shows the type signature for bindings without type signatures, and adds it with a click. |
| 219 | + |
| 220 | +### Evaluation code snippets in comments |
| 221 | +Status: Not supported on GHC 9.2 |
| 222 | + |
| 223 | +Provided by: `hls-eval-plugin` |
| 224 | + |
| 225 | +Evaluates code blocks in comments with a click. [Tutorial](https://github.com/haskell/haskell-language-server/blob/master/plugins/hls-eval-plugin/README.md). |
| 226 | + |
| 227 | + |
| 228 | + |
| 229 | +### Make import lists fully explicit |
| 230 | +Provided by: `hls-explicit-imports-plugin` |
| 231 | + |
| 232 | +Shows fully explicit import lists and rewrites them with a click (same as the code action). |
| 233 | + |
| 234 | + |
| 235 | + |
| 236 | +### Refine import |
| 237 | +Provided by: `hls-refine-imports-plugin` |
| 238 | + |
| 239 | +Shows refined imports and applies them with a click (same as the code action). |
| 240 | + |
| 241 | +### Fix module names |
| 242 | +Provided by: `hls-module-name-plugin` |
| 243 | + |
| 244 | +Shows module name matching file path, and applies it with a click. |
| 245 | + |
| 246 | + |
| 247 | + |
| 248 | +## Missing features |
| 249 | + |
| 250 | +The following features are supported by the LSP specification but not implemented in HLS. |
| 251 | +Contributions welcome! |
| 252 | + |
| 253 | +| Feature | Status | [LSP method](./what-is-hls.md#lsp-terminology) | |
| 254 | +|------------------------|------------------------------------------------------------------------------------------|-----------------------------------------------------| |
| 255 | +| Signature help | Unimplemented | `textDocument/signatureHelp` | |
| 256 | +| Jump to declaration | Unclear if useful | `textDocument/declaration` | |
| 257 | +| Jump to implementation | Unclear if useful | `textDocument/implementation` | |
| 258 | +| Renaming | [Parital implementation](https://github.com/haskell/haskell-language-server/issues/2193) | `textDocument/rename`, `textDocument/prepareRename` | |
| 259 | +| Folding | Unimplemented | `textDocument/foldingRange` | |
| 260 | +| Selection range | Unimplemented | `textDocument/selectionRange` | |
| 261 | +| Semantic tokens | Unimplemented | `textDocument/semanticTokens` | |
| 262 | +| Linked editing | Unimplemented | `textDocument/linkedEditingRange` | |
| 263 | +| Document links | Unimplemented | `textDocument/documentLink` | |
| 264 | +| Document color | Unclear if useful | `textDocument/documentColor` | |
| 265 | +| Color presentation | Unclear if useful | `textDocument/colorPresentation` | |
| 266 | +| Monikers | Unclear if useful | `textDocument/moniker` | |
0 commit comments