Skip to content

Add missing config options in documentation #2203

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 14 commits into from
Sep 20, 2021
Merged

Add missing config options in documentation #2203

merged 14 commits into from
Sep 20, 2021

Conversation

jneira
Copy link
Member

@jneira jneira commented Sep 17, 2021

  • Added diagnosticsDebounceDuration, checkProject, checkParents
  • Also add link to the issue about liquid haskell
  • Change the tone of uding hie.yaml suggestion: the default should be let hls detect it auto

... diagnosticsDebounceDuration, checkProject, checkParents
Aldo add link to the issue about liquid haskell
@jneira jneira changed the title Add missing config options Add missing config options in documentation Sep 17, 2021
- Max completions (`haskell.maxCompletions`, default 40): maximum number of completions sent to the LSP client.
- Check project (`haskell.checkProject`, default true): whether to typecheck the entire project on load. AS it is activate by default could drive to bad perfomance in large projects.
- Check parents (`haskell.checkParents`, default `CheckOnSaveAndClose`): when to typecheck reverse dependencies of a file; one of `NeverCheck`, `CheckOnClose`, `CheckOnSaveAndClose`, or `AlwaysCheck`.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it can affect performance it should be noted how

- Completion snippets (`haskell.completionSnippetsOn`, default true): whether to support completion snippets
- Liquid Haskell (`haskell.liquidOn`, default false): whether to enable Liquid Haskell support (currently unused until the Liquid Haskell support is functional again)
- Hlint (`haskell.hlintOn`, default true): whether to enable Hlint support
- 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).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these might be better as tables?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it will look cleaner

- Actual plugin names are: `ghcide-code-actions-fill-holes`, `ghcide-completions`, `ghcide-hover-and-symbols`, `ghcide-type-lenses`, `ghcide-code-actions-type-signatures`, `ghcide-code-actions-bindings`, `ghcide-code-actions-imports-exports`, `eval`, `moduleName`, `pragmas`, `refineImports`, `importLens`, `class`, `tactics` (aka wingman), `hlint`, `haddockComments`, `retrie`, `splice`.
- So to disable the import lens with an explicit list of module definitions you could set `haskell.plugin.importLens.globalOn: false`
- `haskell.plugin.${pluginName}.${lspCapability}On`: usually with default true. Whether a concrete plugin capability is enabled.
- 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`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤯

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a table here too?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like tables!

Also this is a good conceptual explanation, but for our users I don't think it's enough that they can know which options they can actually set - they'd have to know which plugins have which capabilities.

I think the best thing is just a big, dumb, table. Ideally auto-generated!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree, what do you think about merge this as is and improve it in other pr's?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, definitely!

- `haskell.plugin.ghcide-type-lenses.config.mode`, default `always`: Control how type lenses are shown. One of `always`, `exported`, `diganostics`.
- `hlint`:
- `haskell.plugin.hlint.config.flags`, default empty: List of flags used by hlint.
This reference of configuration can be outdated at any time but we can query the `haskell-server-executable` about what configuration is effectively used:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if we had some way to auto-generate this stuff into the docs. Probably not worth the effort to do fully, but perhaps we could have a halfway house, like:

  • Write a tool like vscode-extension-schema that prints out a markdown or RST table of all the options.
  • Commit the output to the repo. Regenerate it occasionally if we notice it's out of date.
  • Include the generated table into the docs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, but I would do it manually for now in this pr, we could open an issue to track it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking in include the default config/JSON schema directly in docs for reference and link it here, it is easy to regenerate just with actual hls cli output and later we can process it to make it nicer.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, but I don't think we should make our users read a JSON file. Either we'll be making a table by hand or we write something to do it 🤷

@jneira jneira linked an issue Sep 18, 2021 that may be closed by this pull request
@jneira jneira added the merge me Label to trigger pull request merge label Sep 18, 2021
@mergify mergify bot merged commit b6d1df2 into master Sep 20, 2021
cdsmith pushed a commit to cdsmith/haskell-language-server that referenced this pull request Sep 21, 2021
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Label to trigger pull request merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Documenting the new generic config for plugins
3 participants