Make haskell-hlint setup DRY
This commit is contained in:
parent
ef4d5827a1
commit
0a4cdf8202
3 changed files with 9 additions and 10 deletions
|
@ -2,8 +2,4 @@
|
||||||
;;;###if (featurep! +dante)
|
;;;###if (featurep! +dante)
|
||||||
|
|
||||||
(def-package! dante
|
(def-package! dante
|
||||||
:hook (haskell-mode . dante-mode)
|
:hook (haskell-mode . dante-mode))
|
||||||
:config
|
|
||||||
(when (featurep! :feature syntax-checker)
|
|
||||||
(add-hook! 'dante-mode-hook
|
|
||||||
(flycheck-add-next-checker 'haskell-dante '(warning . haskell-hlint)))))
|
|
||||||
|
|
|
@ -13,7 +13,4 @@ This is necessary because `intero-mode' doesn't do its own error checks."
|
||||||
(message "Couldn't find stack. Refusing to enable intero-mode."))))
|
(message "Couldn't find stack. Refusing to enable intero-mode."))))
|
||||||
(add-hook 'haskell-mode-hook #'+haskell|init-intero)
|
(add-hook 'haskell-mode-hook #'+haskell|init-intero)
|
||||||
:config
|
:config
|
||||||
(set-lookup-handlers! 'intero-mode :definition #'intero-goto-definition)
|
(set-lookup-handlers! 'intero-mode :definition #'intero-goto-definition))
|
||||||
(when (featurep! :feature syntax-checker)
|
|
||||||
(add-hook! 'intero-mode
|
|
||||||
(flycheck-add-next-checker 'intero '(warning . haskell-hlint)))))
|
|
||||||
|
|
|
@ -15,5 +15,11 @@
|
||||||
(set-lookup-handlers! 'haskell-mode :definition #'haskell-mode-jump-to-def-or-tag)
|
(set-lookup-handlers! 'haskell-mode :definition #'haskell-mode-jump-to-def-or-tag)
|
||||||
(set-file-template! 'haskell-mode :trigger #'haskell-auto-insert-module-template :project t)
|
(set-file-template! 'haskell-mode :trigger #'haskell-auto-insert-module-template :project t)
|
||||||
(set-repl-handler! '(haskell-mode haskell-cabal-mode literate-haskell-mode) #'+haskell-repl-buffer)
|
(set-repl-handler! '(haskell-mode haskell-cabal-mode literate-haskell-mode) #'+haskell-repl-buffer)
|
||||||
(add-to-list 'completion-ignored-extensions ".hi"))
|
(add-to-list 'completion-ignored-extensions ".hi")
|
||||||
|
|
||||||
|
(when (featurep! :feature syntax-checker)
|
||||||
|
(after! flycheck
|
||||||
|
(dolist (checker (delq nil (list (if (featurep! +intero) 'intero)
|
||||||
|
(if (featurep! +dante) 'haskell-dante))))
|
||||||
|
(flycheck-add-next-checker checker '(warning . haskell-hlint))))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue