Skip to content

Overriding HLS configuration flags #140

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

Closed
korayal opened this issue Dec 2, 2021 · 4 comments
Closed

Overriding HLS configuration flags #140

korayal opened this issue Dec 2, 2021 · 4 comments

Comments

@korayal
Copy link

korayal commented Dec 2, 2021

There are a set of new configuration parameters in HLS that is not yet available in lsp-haskell, so I was trying to override it myself on my Spacemacs setup like below:

  (add-hook 'lsp-mode-hook
            (lambda ()
              (lsp-register-custom-settings

               '(("haskell.formattingProvider" "ormolu")
                 ("haskell.formatOnImportOn" t)
                 ("haskell.completionSnippetsOn" t)
                 ("haskell.liquidOn" :json-false)
                 ("haskell.diagnosticsOnChange" t)
                 ("haskell.checkProject" :json-false)
                 ("haskell.checkParents" "NeverCheck")

                 ("haskell.plugin.ghcide.globalOn" t)
                 ("haskell.plugin.ghcide-completions.config.snippetsOn" t)
                 ("haskell.plugin.hlint.globalOn" t)
                 ("haskell.plugin.pragmas.globalOn" t)
                 ("haskell.plugin.floskell.globalOn" :json-false)
                 ("haskell.plugin.fourmolu.globalOn" :json-false)
                 ("haskell.plugin.ormolu.globalOn" :json-false)
                 ("haskell.plugin.stylish-haskell.globalOn" :json-false)
                 ("haskell.plugin.brittany.globalOn" :json-false)
                 ("haskell.plugin.tactic.globalOn" :json-false)
                 ("haskell.plugin.retrie.globalOn" t)
                 ("haskell.plugin.eval.globalOn" t)
                 ("haskell.plugin.importLens.globalOn" :json-false)
                 ("haskell.plugin.refineImports.globalOn" :json-false)
                 ("haskell.plugin.moduleName.globalOn" t)
                 ))))

My question is; is this the right way of updating this configuration?

@michaelpj
Copy link
Collaborator

I think that's fine. I have been procrastinating on updating all the settings exposed by lsp-haskell, so if you felt up to doing a PR for that it would be very welcome! I think there are even more than that, though. What I've done in the past is start from haskell-language-server vscode-extension-schema and feed it into https://github.com/emacs-lsp/lsp-mode/blob/master/scripts/lsp-generate-settings.el

@korayal
Copy link
Author

korayal commented Dec 6, 2021

Thank you! looks like vscode-extension-schema is missing some part of the configuration. so haskell-language-server generate-default-config feels like a better option to get the list of available configuration. But, that one is missing the details like description enum types etc. so we probably need a way to combine these two JSONs.

@michaelpj
Copy link
Collaborator

Ugh, how annoying. Maybe try mentioning the discrepancies upstream in HLS, they might have suggestions. I don't really know where that stuff comes from!

@michaelpj
Copy link
Collaborator

Settings should be up to date, and there's a snippet in the readme about putting in extra settings now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants