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 ;; local completions in 'where' and 'let' clauses
'((company-capf company-dabbrev-code)))) '((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 (use-package haskell-mode
:straight t :straight t
:hook ((haskell-mode . origami-mode) :hook ((haskell-mode . origami-mode)
(haskell-mode . company-mode) (haskell-mode . company-mode)
(haskell-mode . flycheck-haskell-setup)
(haskell-mode . haskell-indentation-mode) (haskell-mode . haskell-indentation-mode)
;; this enables better integration with the running GHCi process ;; this enables better integration with the running GHCi process
;; NOTE this is NOT the same is haskell-interactive-mode which is used ;; 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 ;; unnecessary to see on the modeline
(delight 'subword-mode nil "subword")) (delight 'subword-mode nil "subword"))
#+END_SRC #+END_SRC
**** hlint **** hlint
This is an additional syntax checker and requires the =hlint= binary. This is an additional syntax checker and requires the =hlint= binary.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(nd/require-bin "hlint" :aur "hlint-bin") (with-eval-after-load 'haskell
(flycheck-add-next-checker 'haskell-stack-ghc '(t . haskell-hlint)))
(nd/when-bin "hlint"
(with-eval-after-load 'haskell
(flycheck-add-next-checker 'haskell-stack-ghc '(t . haskell-hlint))))
#+END_SRC #+END_SRC
**** helper functions **** helper functions
Other helper functions that make haskell even more fun. Other helper functions that make haskell even more fun.