Setup all the plugins for haskell lsp server

This commit is contained in:
Sameer Rahmani 2024-05-24 22:03:30 +01:00
parent 11086cd7c1
commit 4bce452ca7
Signed by: lxsameer
GPG Key ID: 8741FACBF412FFA5
1 changed files with 26 additions and 20 deletions

View File

@ -30,21 +30,22 @@
(require 'eglot)
;; This is just a referece for the future
(setq-default eglot-workspace-configuration
(mapcar
(lambda (x) `(haskell
(plugin
(,x
(globalOn . t)))))
'(ghcide-code-actions-fill-holes
ghcide-completions
ghcide-hover-and-symbols
ghcide-code-actions-type-signatures
ghcide-code-actions-bindings
ghcide-code-actions-imports-exports
class
hlint
splice
stan)))
`((haskell
(plugin
,@(mapcar
(lambda (x)
`(,x
(globalOn . t)))
'(ghcide-code-actions-fill-holes
ghcide-completions
ghcide-hover-and-symbols
ghcide-code-actions-type-signatures
ghcide-code-actions-bindings
ghcide-code-actions-imports-exports
class
hlint
splice
stan))))))
(eglot-ensure))
@ -56,21 +57,26 @@
:config
(require 'haskell)
;; We use lang server for this
(setq haskell-stylish-on-save nil)
;; The upstream default is:
;; cabal build --ghc-option=-ferror-spans
(setq-default haskell-compile-cabal-build-command "cabal v2-build --ghc-option=-ferror-spans")
(setq-default haskell-process-type 'cabal-new-repl)
(setq-default haskell-completing-read-function #'completing-read)
(defun haskell-setup-outline-mode ()
(make-local-variable 'outline-regexp)
(setq outline-regexp "\\`\\|\\s-+\\S-"))
:custom
(eglot-autoshutdown t) ;; shutdown language server after closing last file
(eglot-confirm-server-initiated-edits nil) ;; allow edits without confirmation
:hook
(haskell-mode . fg42/ensure-lang-server)
(haskell-mode . fg42/setup-completion)
(haskell-mode . flyspell-prog-mode)
(haskell-mode . interactive-haskell-mode)
(haskell-mode . turn-on-haskell-doc-mode)
(haskell-mode . haskell-indent-mode)
(haskell-mode . haskell-indentation-mode)
(haskell-mode . haskell-setup-outline-mode)
:bind