diff --git a/nix/modules/haskell/lisp/fg42/haskell-support.el b/nix/modules/haskell/lisp/fg42/haskell-support.el index c0f8cfa..ec93013 100644 --- a/nix/modules/haskell/lisp/fg42/haskell-support.el +++ b/nix/modules/haskell/lisp/fg42/haskell-support.el @@ -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