-
-
Notifications
You must be signed in to change notification settings - Fork 391
Rework features documentation #2603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
73eef27
Rework features documentation
michaelpj 05bc777
Add a couple of known limitations
michaelpj 1614a9f
Move plugin GHC version support to other page
michaelpj b048784
Purge useless status column
michaelpj 5797eb9
Update docs/features.md
eddiemundo 49db369
Update docs/features.md
eddiemundo 42527ba
Update docs/features.md
eddiemundo ff4f00a
Update docs/features.md
eddiemundo 10abe6c
Update docs/features.md
eddiemundo 46d4c71
Update docs/features.md
eddiemundo 9161140
Merge branch 'master' into mpj/features-doc
michaelpj 002a96c
Merge branch 'master' into mpj/features-doc
pepeiborra 0171d34
Clarify text
michaelpj 28369f7
Mention limitations of apply-refact
michaelpj c51c26f
Merge branch 'master' into mpj/features-doc
mergify[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* Fix table wrapping https://github.com/readthedocs/sphinx_rtd_theme/issues/117 */ | ||
@media screen and (min-width: 768px) { | ||
.wy-table-responsive table td, .wy-table-responsive table th { | ||
white-space: normal !important; | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,260 @@ | ||
# Features | ||
|
||
You can watch demos for some of these features [below](#demos). | ||
|
||
- Warning and error diagnostics from GHC | ||
- Type information and documentation on hover, [including your own comments](./configuration.md#how-to-show-local-documentation-on-hover). | ||
- Jump to definition: [for now only for local code definitions](https://github.com/haskell/haskell-language-server/issues/708) | ||
- Document symbols | ||
- Highlight references in document | ||
- Code completion | ||
- 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) | ||
- [Code evaluation](#code-evaluation), see its [Tutorial](https://github.com/haskell/haskell-language-server/blob/master/plugins/hls-eval-plugin/README.md) | ||
- [Integration with](#retrie-integration) [retrie](https://hackage.haskell.org/package/retrie), a powerful, easy-to-use codemodding tool | ||
- [Code lenses for explicit import lists](#explicit-import-lists) | ||
- [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) | ||
- [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) | ||
- [Module name suggestions](#module-names) for insertion or correction | ||
- [Call hierarchy support](#call-hierarchy) | ||
- [Qualify names from an import declaration](#qualify-imported-names) in your code | ||
- [Suggest alternate numeric formats](#alternate-number-formatting) | ||
|
||
## Demos | ||
|
||
### Code evaluation | ||
This table gives a summary of the features that HLS supports. | ||
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). | ||
|
||
 | ||
| Feature | [LSP method](./what-is-hls.md#lsp-terminology) | | ||
|-----------------------------------------------------|---------------------------------------------------------------------------------------------------| | ||
| [Diagnostics](#diagnostics) | `textDocument/publishDiagnostics` | | ||
| [Hovers](#hovers) | `textDocument/hover` | | ||
| [Jump to definition](#jump-to-definition) | `textDocument/definition` | | ||
| [Jump to type definition](#jump-to-type-definition) | `textDocument/typeDefinition` | | ||
| [Find references](#find-references) | `textDocument/references` | | ||
| [Completions](#completions) | `textDocument/completion` | | ||
| [Formatting](#formatting) | `textDocument/formatting`, `textDocument/rangeFormatting` | | ||
| [Document symbols](#document-symbols) | `textDocument/documentSymbol` | | ||
| [Workspace symbols](#workspace-symbols) | `workspace/symbol` | | ||
| [Call hierarchy](#call-hierarchy) | `textDocument/prepareCallHierarchy`, `callHierarchy/incomingCalls`, `callHierarchy/outgoingCalls` | | ||
| [Highlight references](#highlight-references) | `textDocument/documentHighlight` | | ||
| [Code actions](#code-actions) | `textDocument/codeAction` | | ||
| [Code lenses](#code-lenses) | `textDocument/codeLens` | | ||
|
||
### Retrie integration | ||
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! | ||
Additionally, not all plugins are supported on all versions of GHC, see the [GHC version support page](supported-versions.md) for details. | ||
|
||
 | ||
## Diagnostics | ||
|
||
### Explicit import lists | ||
### GHC compiler errors and warnings | ||
Provided by: `ghcide` | ||
|
||
 | ||
Provides errors and warnings from GHC as diagnostics. | ||
|
||
### Wingman | ||
### Hlint hints | ||
Provided by: `hls-hlint-plugin` | ||
|
||
 | ||
Provides hlint hints as diagnostics. | ||
|
||
### Hlint | ||
## Hovers | ||
Provided by: `ghcide` | ||
|
||
 | ||
Type information and documentation on hover, [including from local definitions](./configuration.md#how-to-show-local-documentation-on-hover). | ||
|
||
### Module names | ||
## Jump to definition | ||
Provided by: `ghcide` | ||
|
||
 | ||
Jump to the definition of a name. | ||
|
||
Known limitations: | ||
- Only works for [local definitions](https://github.com/haskell/haskell-language-server/issues/708). | ||
|
||
## Jump to type definition | ||
Provided by: `ghcide` | ||
|
||
Known limitations: | ||
- Only works for [local definitions](https://github.com/haskell/haskell-language-server/issues/708). | ||
|
||
## Find references | ||
Provided by: `ghcide` | ||
|
||
Find references to a name within the project. | ||
|
||
## Completions | ||
|
||
### Code completions | ||
Provided by: `ghcide` | ||
|
||
- Completion of names from qualified imports. | ||
- Completion of names from non-imported modules. | ||
|
||
### Pragma completions | ||
Provided by: `hls-pragmas-plugin` | ||
|
||
Completions for language pragmas. | ||
|
||
## Formatting | ||
Format your code with various Haskell code formatters. | ||
|
||
| Formatter | Provided by | | ||
|-----------------|------------------------------| | ||
| Brittany | `hls-brittany-plugin` | | ||
| Floskell | `hls-floskell-plugin` | | ||
| Fourmolu | `hls-fourmolu-plugin` | | ||
| Ormolu | `hls-ormolu-plugin` | | ||
| Stylish Haskell | `hls-stylish-haskell-plugin` | | ||
|
||
## Document symbols | ||
Provided by: `ghcide` | ||
|
||
Provides listing of the symbols defined in a module, used to power outline displays. | ||
|
||
## Workspace symbols | ||
Provided by: `ghcide` | ||
|
||
Provides listing of the symbols defined in the project, used to power searches. | ||
|
||
### Call hierarchy | ||
## Call hierarchy | ||
Provided by: `hls-call-hierarchy-plugin` | ||
|
||
Shows ingoing and outgoing calls for a function. | ||
|
||
 | ||
|
||
## Highlight references | ||
Provided by: `ghcide` | ||
|
||
Highlights references to a name in a document. | ||
|
||
## Code actions | ||
|
||
### Insert missing pragmas | ||
Provided by: `hls-pragma-plugin` | ||
|
||
Code action kind: `quickfix` | ||
|
||
Inserts missing pragmas needed by GHC. | ||
|
||
### Apply Hlint fixes | ||
Provided by: `hls-hlint-plugin` | ||
|
||
Code action kind: `quickfix` | ||
|
||
Applies hints, either individually or for the whole file. | ||
Uses [apply-refact](https://github.com/mpickering/apply-refact). | ||
|
||
 | ||
|
||
Known limitations: | ||
- May have strange behaviour in files with CPP, since `apply-refact` does not support CPP. | ||
|
||
### Make import lists fully explicit | ||
Provided by: `hls-explicit-imports-plugin` | ||
|
||
Code action kind: `quickfix.literals.style` | ||
|
||
Make import lists fully explicit (same as the code lens). | ||
|
||
### Qualify imported names | ||
Provided by: `hls-qualify-imported-names-plugin` | ||
|
||
Code action kind: `quickfix` | ||
|
||
Rewrites imported names to be qualified. | ||
|
||
 | ||
|
||
For usage see the . | ||
|
||
### Refine import | ||
Provided by: `hls-refine-imports-plugin` | ||
|
||
Code action kind: `quickfix.import.refine` | ||
|
||
Refines imports to more specific modules when names are re-exported (same as the code lens). | ||
|
||
### Add missing class methods | ||
Provided by: `hls-class-plugin` | ||
|
||
### Alternate Number Formatting | ||
Code action kind: `quickfix` | ||
|
||
Adds placeholders for missing class methods in a class instance definition. | ||
|
||
### Unfold definition | ||
Provided by: `hls-retrie-plugin` | ||
|
||
Code action kind: `refactor.extract` | ||
|
||
Extracts a definition from the code. | ||
|
||
### Fold definition | ||
Provided by: `hls-retrie-plugin` | ||
|
||
Code action kind: `refactor.inline` | ||
|
||
Inlines a definition from the code. | ||
|
||
 | ||
|
||
### Insert contents of Template Haskell splice | ||
Provided by: `hls-splice-plugin` | ||
|
||
Code action kind: `refactor.rewrite` | ||
|
||
Evaluates a Template Haskell splice and inserts the resulting code in its place. | ||
|
||
### Convert numbers to alternative formats | ||
Provided by: `hls-alternate-number-format-plugin` | ||
|
||
Code action kind: `quickfix.literals.style` | ||
|
||
Converts numeric literals to different formats. | ||
|
||
 | ||
|
||
### Add Haddock comments | ||
Provided by: `hls-haddock-comments-plugin` | ||
|
||
Code action kind: `quickfix` | ||
|
||
Adds Haddock comments for function arguments. | ||
|
||
### Wingman | ||
Status: Not supported on GHC 9.2 | ||
|
||
Provided by: `hls-tactics-plugin` | ||
|
||
Provides a variety of code actions for interactive code development, see https://haskellwingman.dev/ for more details. | ||
|
||
 | ||
|
||
## Code lenses | ||
|
||
### Add type signature | ||
Provided by: `ghcide` | ||
|
||
Shows the type signature for bindings without type signatures, and adds it with a click. | ||
|
||
### Evaluation code snippets in comments | ||
Provided by: `hls-eval-plugin` | ||
|
||
Evaluates code blocks in comments with a click. [Tutorial](https://github.com/haskell/haskell-language-server/blob/master/plugins/hls-eval-plugin/README.md). | ||
|
||
 | ||
|
||
### Make import lists fully explicit | ||
Provided by: `hls-explicit-imports-plugin` | ||
|
||
Shows fully explicit import lists and rewrites them with a click (same as the code action). | ||
|
||
 | ||
|
||
### Refine import | ||
Provided by: `hls-refine-imports-plugin` | ||
|
||
Shows refined imports and applies them with a click (same as the code action). | ||
|
||
### Fix module names | ||
Provided by: `hls-module-name-plugin` | ||
|
||
Shows module name matching file path, and applies it with a click. | ||
|
||
 | ||
|
||
## Missing features | ||
|
||
The following features are supported by the LSP specification but not implemented in HLS. | ||
Contributions welcome! | ||
|
||
| Feature | Status | [LSP method](./what-is-hls.md#lsp-terminology) | | ||
|------------------------|------------------------------------------------------------------------------------------|-----------------------------------------------------| | ||
| Signature help | Unimplemented | `textDocument/signatureHelp` | | ||
| Jump to declaration | Unclear if useful | `textDocument/declaration` | | ||
| Jump to implementation | Unclear if useful | `textDocument/implementation` | | ||
| Renaming | [Parital implementation](https://github.com/haskell/haskell-language-server/issues/2193) | `textDocument/rename`, `textDocument/prepareRename` | | ||
| Folding | Unimplemented | `textDocument/foldingRange` | | ||
| Selection range | Unimplemented | `textDocument/selectionRange` | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does it worth mention the wip pr #2565? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Eh, I'd wait until it's merged. It might never be, who knows! |
||
| Semantic tokens | Unimplemented | `textDocument/semanticTokens` | | ||
| Linked editing | Unimplemented | `textDocument/linkedEditingRange` | | ||
| Document links | Unimplemented | `textDocument/documentLink` | | ||
| Document color | Unclear if useful | `textDocument/documentColor` | | ||
| Color presentation | Unclear if useful | `textDocument/colorPresentation` | | ||
| Monikers | Unclear if useful | `textDocument/moniker` | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.