forked from FG42/FG42
1
0
Fork 0

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) (require 'eglot)
;; This is just a referece for the future ;; This is just a referece for the future
(setq-default eglot-workspace-configuration (setq-default eglot-workspace-configuration
(mapcar `((haskell
(lambda (x) `(haskell (plugin
(plugin ,@(mapcar
(,x (lambda (x)
(globalOn . t))))) `(,x
'(ghcide-code-actions-fill-holes (globalOn . t)))
ghcide-completions '(ghcide-code-actions-fill-holes
ghcide-hover-and-symbols ghcide-completions
ghcide-code-actions-type-signatures ghcide-hover-and-symbols
ghcide-code-actions-bindings ghcide-code-actions-type-signatures
ghcide-code-actions-imports-exports ghcide-code-actions-bindings
class ghcide-code-actions-imports-exports
hlint class
splice hlint
stan))) splice
stan))))))
(eglot-ensure)) (eglot-ensure))
@ -56,21 +57,26 @@
:config :config
(require 'haskell) (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 () (defun haskell-setup-outline-mode ()
(make-local-variable 'outline-regexp) (make-local-variable 'outline-regexp)
(setq outline-regexp "\\`\\|\\s-+\\S-")) (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 :hook
(haskell-mode . fg42/ensure-lang-server) (haskell-mode . fg42/ensure-lang-server)
(haskell-mode . fg42/setup-completion) (haskell-mode . fg42/setup-completion)
(haskell-mode . flyspell-prog-mode) (haskell-mode . flyspell-prog-mode)
(haskell-mode . interactive-haskell-mode) (haskell-mode . interactive-haskell-mode)
(haskell-mode . turn-on-haskell-doc-mode) (haskell-mode . turn-on-haskell-doc-mode)
(haskell-mode . haskell-indent-mode) (haskell-mode . haskell-indentation-mode)
(haskell-mode . haskell-setup-outline-mode) (haskell-mode . haskell-setup-outline-mode)
:bind :bind