Overriding HLS configuration flags
korayal opened this issue · 4 comments
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?
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
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.
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!
Settings should be up to date, and there's a snippet in the readme about putting in extra settings now.