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 and code lenses.
The individual sections below also identify which HLS plugin 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 plugin support page for details.
Diagnostics GHC compiler errors and warningsProvided by: ghcide
Provides errors and warnings from GHC as diagnostics.
Hlint hintsProvided by: hls-hlint-plugin
Provides hlint hints as diagnostics.
Stan hintsProvided by: hls-stan-plugin
Provides Stan hints as diagnostics.
Cabal parse errors and warningsProvided by: hls-cabal-plugin
Provides errors and warnings from Cabal as diagnostics
HoversProvided by: ghcide
Type information and documentation on hover, including from local definitions.
Show fixityProvided by: hls-explicit-fixity-plugin
Provides fixity information.
Jump to definitionProvided by: ghcide
Jump to the definition of a name.
Known limitations:
Only works for local definitions.
Provided by: ghcide
Known limitations:
Only works for local definitions.
Provided by: ghcide
Jump to the implementation instance of a type class method.
Known limitations:
Only works for local definitions.
Provided by: hls-notes-plugin
Jump to the definition of a GHC-style note.
Find referencesProvided by: ghcide
Find references to a name within the project.
Completions Code completionsProvided by: ghcide
Completion of names from qualified imports.
Completion of names from non-imported modules.
Provided by: hls-pragmas-plugin
Completions for language pragmas.
FormattingFormat your code with various Haskell code formatters. The default Haskell code formatter is ormolu
, and the Haskell formatter can be configured via the formattingProvider
option.
Formatter
Provided by
Floskell
hls-floskell-plugin
Fourmolu
hls-fourmolu-plugin
Ormolu
hls-ormolu-plugin
Stylish Haskell
hls-stylish-haskell-plugin
Format your cabal files with a cabal code formatter. The default cabal code formatter is cabal-gild
, which needs to be available on the $PATH
, or the location needs to be explicitly provided. To change the cabal formatter, edit the cabalFormattingProvider
option.
Formatter
Provided by
cabal-fmt
hls-cabal-fmt-plugin
cabal-gild
hls-cabal-gild-plugin
Provided by: ghcide
Provides listing of the symbols defined in a module, used to power outline displays.
Workspace symbolsProvided by: ghcide
Provides listing of the symbols defined in the project, used to power searches.
Call hierarchyProvided by: hls-call-hierarchy-plugin
Shows ingoing and outgoing calls for a function.
Highlight referencesProvided by: ghcide
Highlights references to a name in a document.
Code actions Insert missing pragmasProvided by: hls-pragma-plugin
Code action kind: quickfix
Inserts missing pragmas needed by GHC.
Apply Hlint fixesProvided by: hls-hlint-plugin
Code action kind: quickfix
Applies hints, either individually or for the whole file. Uses apply-refact.
Known limitations:
May have strange behaviour in files with CPP, since apply-refact
does not support CPP.
The hlint
executable by default turns on many extensions when parsing a file because it is not certain about the exact extensions that apply to the file (they may come from project files). This differs from HLS which uses only the extensions the file needs to parse the file. Hence it is possible for the hlint
executable to report a parse error on a file, but the hlint
plugin to work just fine on the same file. This does mean that the turning on/off of extensions in the hlint config may be ignored by the hlint
plugin.
Hlint restrictions do not work (yet). This PR should enable that functionality, but this requires a newer version of hlint to be used in HLS.
Provided by: hls-explicit-imports-plugin
Code action kind: quickfix.literals.style
Make import lists fully explicit (same as the code lens).
Refine importProvided by: hls-explicit-imports-plugin
Code action kind: quickfix.import.refine
Refines imports to more specific modules when names are re-exported (same as the code lens).
Qualify imported namesProvided by: hls-qualify-imported-names-plugin
Code action kind: quickfix
Rewrites imported names to be qualified.
For usage see the readme.
Add missing class methodsProvided by: hls-class-plugin
Code action kind: quickfix
Adds placeholders for missing class methods in a class instance definition.
Unfold definitionProvided by: hls-retrie-plugin
Code action kind: refactor.extract
Extracts a definition from the code.
Fold definitionProvided by: hls-retrie-plugin
Code action kind: refactor.inline
Inlines a definition from the code.
Insert contents of Template Haskell spliceProvided 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 formatsProvided by: hls-alternate-number-format-plugin
Code action kind: quickfix.literals.style
Converts numeric literals to different formats.
Change Type SignatureProvided by: hls-change-type-signature-plugin
Code action kind: quickfix
Change/Update a type signature to match implementation.
Status: Until GHC 9.4, the implementation is ad-hoc and relies on GHC error messages to create a new signature. Not all GHC error messages are supported.
Known Limitations:
Not all GHC error messages are supported
Top-level and Function-local bindings with the same names can cause issues, such as incorrect signature changes or no code actions available.
Provided by: hls-refactor-plugin
Code action kind: quickfix
Add an undefined variable as an argument to the top-level binding.
Convert to GADT syntaxProvided by: hls-gadt-plugin
Code action kind: refactor.rewrite
Convert a datatype to GADT syntax.
Expand record wildcardProvided by: hls-explicit-record-fields-plugin
Code action kind: refactor.rewrite
Expand record wildcards, explicitly listing all record fields as field puns.
Unknown SPDX License suggestionProvided by: hls-cabal-plugin
Code action kind: quickfix
Correct common misspelling of SPDX Licenses such as BSD-3-Clause
.
cabal
file
Provided by: hls-cabal-plugin
Code action kind: quickfix
Add a missing package dependency to your .cabal
file.
Provided by: ghcide
Shows the type signature for bindings without type signatures, and adds it with a click.
Make import lists fully explicit code lensProvided by: hls-explicit-imports-plugin
Shows fully explicit import lists and rewrites them with a click (same as the code action).
Refine import code lensProvided by: hls-explicit-imports-plugin
Shows refined imports and applies them with a click (same as the code action).
Fix module namesProvided by: hls-module-name-plugin
Shows module name matching file path, and applies it with a click.
Selection rangeProvided by: hls-code-range-plugin
Provides haskell specific shrink/expand selection support.
Folding rangeProvided by: hls-code-range-plugin
Provides haskell specific Folding support.
RenameProvided by: hls-rename-plugin
Provides renaming of symbols within a module. Experimental cross-module renaming can be enabled via the configuration.
Known limitations:
Cross-module renaming requires all components to be indexed, which sometimes causes partial renames in multi-component projects.
To eagerly load all components, you need to
set haskell.sessionLoading
to multipleComponents
,
set hie.yaml
to load all components (currently only cabal supports this),
cradle: cabal: component: all
and enable tests and benchmarks in cabal.project
with tests: True
and benchmarks: True
.
Provided by: hls-semantic-tokens-plugin
Provides semantic tokens for each token in the source code to support semantic highlighting.
Rewrite to overloaded record syntaxProvided by: hls-overloaded-record-dot-plugin
Code action kind: refactor.rewrite
Rewrites record selectors to use overloaded dot syntax
Missing featuresThe following features are supported by the LSP specification but not implemented in HLS. Contributions welcome!
Feature
Status
Signature help
Unimplemented
textDocument/signatureHelp
Jump to declaration
Unclear if useful
textDocument/declaration
Jump to implementation
Unclear if useful
textDocument/implementation
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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4