ADD haskell flycheck mode to integrate better with cabal/stack

This commit is contained in:
Nathan Dwarshuis 2023-02-12 13:51:42 -05:00
parent e2ac704185
commit b7abf1ae1e
1 changed files with 9 additions and 5 deletions

View File

@ -1083,10 +1083,16 @@ I have also found this to be much simpler and conflicting with other packages su
;; local completions in 'where' and 'let' clauses
'((company-capf company-dabbrev-code))))
;; flycheck setup (needed to get flycheck to pay attention to flags/extensions
;; in cabal files)
(use-package flycheck-haskell
:straight t)
(use-package haskell-mode
:straight t
:hook ((haskell-mode . origami-mode)
(haskell-mode . company-mode)
(haskell-mode . flycheck-haskell-setup)
(haskell-mode . haskell-indentation-mode)
;; this enables better integration with the running GHCi process
;; NOTE this is NOT the same is haskell-interactive-mode which is used
@ -1115,15 +1121,13 @@ I have also found this to be much simpler and conflicting with other packages su
;; unnecessary to see on the modeline
(delight 'subword-mode nil "subword"))
#+END_SRC
**** hlint
This is an additional syntax checker and requires the =hlint= binary.
#+BEGIN_SRC emacs-lisp
(nd/require-bin "hlint" :aur "hlint-bin")
(nd/when-bin "hlint"
(with-eval-after-load 'haskell
(flycheck-add-next-checker 'haskell-stack-ghc '(t . haskell-hlint))))
(flycheck-add-next-checker 'haskell-stack-ghc '(t . haskell-hlint)))
#+END_SRC
**** helper functions
Other helper functions that make haskell even more fun.