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
Add missing config options in documentation (haskell#2203)
* Add missing config options
... diagnosticsDebounceDuration, checkProject, checkParents
Aldo add link to the issue about liquid haskell
* Section about generic plugin configuration
* Add plugin specific config
* Mark haskell.completionSnippetsOn as deprecated
* Remove unused diagnosticsDebounceDuration
* Correct typos
* Change tone of using hie.yaml suggestion
To make clear the default should be let hls detect it automatically
* Update exclude list precommit hook
* Remove diagnosticsDebounceDuration from source code
* Correct typo
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Copy file name to clipboardExpand all lines: docs/configuration.md
+40-10
Original file line number
Diff line number
Diff line change
@@ -40,14 +40,45 @@ This option obviously would not make sense for language servers for other langua
40
40
41
41
Here is a list of the additional settings currently supported by `haskell-language-server`, along with their setting key (you may not need to know this) and default:
42
42
43
-
- Formatting provider (`haskell.formattingProvider`, default `ormolu`): what formatter to use; one of `floskell`, `ormolu`, `fourmolu`, `stylish-haskell`, or `brittany` (if compiled with the brittany plugin)
44
-
- Format on imports (`haskell.formatOnImportOn`, default true): whether to format after adding an import
45
-
- Diagnostics on change (`haskell.diagnosticsOnChange`, default true): (currently unused)
46
-
- Completion snippets (`haskell.completionSnippetsOn`, default true): whether to support completion snippets
47
-
- Liquid Haskell (`haskell.liquidOn`, default false): whether to enable Liquid Haskell support (currently unused until the Liquid Haskell support is functional again)
48
-
- Hlint (`haskell.hlintOn`, default true): whether to enable Hlint support
43
+
- Formatting provider (`haskell.formattingProvider`, default `ormolu`): what formatter to use; one of `floskell`, `ormolu`, `fourmolu`, `stylish-haskell`, or `brittany` (if compiled with the brittany plugin).
44
+
- Format on imports (`haskell.formatOnImportOn`, default true): whether to format after adding an import.
45
+
- Diagnostics on change (`haskell.diagnosticsOnChange`, default true): (currently unused).
46
+
- Completion snippets (`haskell.completionSnippetsOn`, default true): whether to support completion snippets. *Deprecated* as it is equivalent to `haskell.plugin.ghcide-completions.config.snippetsOn`.
47
+
- Liquid Haskell (`haskell.liquidOn`, default false): whether to enable Liquid Haskell support (currently unused until the Liquid Haskell support is functional again, see <https://github.com/haskell/haskell-language-server/issues/367>).
48
+
- Hlint (`haskell.hlintOn`, default true): whether to enable Hlint support. *Deprecated* as it is equivalen to `haskell.plugin.hlint.globalOn`
49
49
- Max completions (`haskell.maxCompletions`, default 40): maximum number of completions sent to the LSP client.
50
-
50
+
- Check project (`haskell.checkProject`, default true): whether to typecheck the entire project on load. As it is activated by default could drive to bad perfomance in large projects.
51
+
- Check parents (`haskell.checkParents`, default `CheckOnSaveAndClose`): when to typecheck reverse dependencies of a file; one of `NeverCheck`, `CheckOnClose`, `CheckOnSaveAndClose`, or `AlwaysCheck`.
52
+
53
+
#### Generic plugin configuration
54
+
55
+
Plugins have a generic config to control their behaviour. The schema of such config is:
56
+
57
+
-`haskell.plugin.${pluginName}.globalOn`: usually with default true. Whether the plugin is enabled at runtime or it is not. That is the option you might use if you want to disable completely a plugin.
- So to disable the import lens with an explicit list of module definitions you could set `haskell.plugin.importLens.globalOn: false`
60
+
-`haskell.plugin.${pluginName}.${lspCapability}On`: usually with default true. Whether a concrete plugin capability is enabled.
61
+
- Capabilities are the different ways a lsp server can interact with the editor. The current available capabilities of the server are: `callHierarchy`, `codeActions`, `codeLens`, `diagnostics`, `hover`, `symbols`, `completion`, `rename`.
62
+
- Note that usually plugins don't provide all capabilities but some of them or even only one.
63
+
- So to disable code changes suggestions from the `hlint` plugin (but no diagnostics) you could set `haskell.plugin.hlint.codeActionsOn: false`
64
+
- Plugin specific configuration:
65
+
-`tactic` (aka wingman):
66
+
-`haskell.plugin.tactics.config.auto_gas`, default 4: The depth of the search tree when performing "Attempt to fill hole". Bigger values will be able to derive more solutions, but will take exponentially more time.
67
+
-`haskell.plugin.tactics.config.timeout_duration`, default 2: The timeout for Wingman actions, in seconds.
68
+
-`haskell.plugin.tactics.config.hole_severity`, default empty: The severity to use when showing hole diagnostics. These are noisy, but some editors don't allow jumping to all severities. One of `error`, `warning`, `info`, `hint`, `none`.
69
+
-`haskell.plugin.tactics.config.max_use_ctor_actions`, default 5: Maximum number of `Use constructor <x>` code actions that can appear.
70
+
-`haskell.plugin.tactics.config.proofstate_styling`, default true: Should Wingman emit styling markup when showing metaprogram proof states?
71
+
-`ghcide-completions`:
72
+
-`haskell.plugin.ghcide-completions.config.snippetsOn`, default true: Inserts snippets when using code completions.
73
+
-`haskell.plugin.ghcide-completions.config.autoExtendOn`, default true: Extends the import list automatically when completing a out-of-scope identifier.
74
+
-`ghcide-type-lenses`:
75
+
-`haskell.plugin.ghcide-type-lenses.config.mode`, default `always`: Control how type lenses are shown. One of `always`, `exported`, `diganostics`.
76
+
-`hlint`:
77
+
-`haskell.plugin.hlint.config.flags`, default empty: List of flags used by hlint.
78
+
This reference of configuration can be outdated at any time but we can query the `haskell-server-executable` about what configuration is effectively used:
79
+
-`haskell-language-server generate-default-config`: will print the json configuration with all default values. It can be used as template to modify it.
80
+
-`haskell-language-server vscode-extension-schema`: will print a json schema used to setup the haskell vscode extension. But it is useful to see what range of values can an option take and a description about it.
81
+
51
82
Settings like this are typically provided by the language-specific LSP client support for your editor, for example in Emacs by `lsp-haskell`.
52
83
53
84
### Client options
@@ -63,10 +94,9 @@ This is handled by the [`hie-bios`](https://github.com/mpickering/hie-bios) proj
63
94
64
95
**For a full explanation of how `hie-bios` determines the project build configuration, and how to configure it manually, refer to the [`hie-bios` README](https://github.com/mpickering/hie-bios/blob/master/README.md).**
65
96
66
-
At the moment, `haskell-language-server` has some limited support to automatically detect your project build configuration.
67
-
The plan is to improve it to handle most use cases.
97
+
At the moment, `haskell-language-server` has support to automatically detect your project build configuration to handle most use cases.
68
98
69
-
However, for now, the most reliable way is to manually configure `hie-bios` using a `hie.yaml` file in the root of the workspace.
99
+
However, if the automatic detection fails you can configure `hie-bios` using a `hie.yaml` file in the root of the workspace.
70
100
A `hie.yaml` file **explicitly** describes how to setup the environment to compile the various parts of your project.
71
101
For that you need to know what *components* your project has, and the path associated with each one.
0 commit comments