From 2968374081bd75b20224b1f49c189bde2eee8c4b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 17 Jul 2018 23:47:57 +0200 Subject: [PATCH] lang/haskell: fix haskell-hlint checker Causing "not a valid syntax checker" errors because it haskell-hlint was defined too soon. --- modules/lang/haskell/+dante.el | 5 ++++- modules/lang/haskell/+intero.el | 4 +++- modules/lang/haskell/config.el | 8 +------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/modules/lang/haskell/+dante.el b/modules/lang/haskell/+dante.el index 51a9e3be4..5c7dd96f6 100644 --- a/modules/lang/haskell/+dante.el +++ b/modules/lang/haskell/+dante.el @@ -2,4 +2,7 @@ ;;;###if (featurep! +dante) (def-package! dante - :hook (haskell-mode . dante-mode)) + :hook (haskell-mode . dante-mode) + :config + (when (featurep! :feature syntax-checker) + (flycheck-add-next-checker 'haskell-dante '(warning . haskell-hlint)))) diff --git a/modules/lang/haskell/+intero.el b/modules/lang/haskell/+intero.el index 5dc501743..87d9ab65c 100644 --- a/modules/lang/haskell/+intero.el +++ b/modules/lang/haskell/+intero.el @@ -13,4 +13,6 @@ This is necessary because `intero-mode' doesn't do its own error checks." (message "Couldn't find stack. Refusing to enable intero-mode.")))) (add-hook 'haskell-mode-hook #'+haskell|init-intero) :config - (set-lookup-handlers! 'intero-mode :definition #'intero-goto-definition)) + (set-lookup-handlers! 'intero-mode :definition #'intero-goto-definition) + (when (featurep! :feature syntax-checker) + (flycheck-add-next-checker 'intero '(warning . haskell-hlint)))) diff --git a/modules/lang/haskell/config.el b/modules/lang/haskell/config.el index 3facd2086..dd5b6d1b4 100644 --- a/modules/lang/haskell/config.el +++ b/modules/lang/haskell/config.el @@ -15,11 +15,5 @@ (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-repl-handler! '(haskell-mode haskell-cabal-mode literate-haskell-mode) #'+haskell-repl-buffer) - (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)))))) + (add-to-list 'completion-ignored-extensions ".hi"))