From ceb985673ccd2be869bdde2ea4f41c84e9354f1e Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 23 Oct 2022 02:52:42 +0200 Subject: [PATCH] fix(haskell): activate lsp! conditionally use-package evaluates :preface *before* :when, so the two lsp! hooks would run unconditionally, causing errors and warnings when opening a haskell-mode buffer. * modules/lang/haskell/config.el (haskell-literate-mode-local-vars-hook): add lsp! to hook. --- modules/lang/haskell/config.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/lang/haskell/config.el b/modules/lang/haskell/config.el index 4d3888624..5878d18ef 100644 --- a/modules/lang/haskell/config.el +++ b/modules/lang/haskell/config.el @@ -45,8 +45,11 @@ (use-package! lsp-haskell :when (modulep! +lsp) - :after lsp-mode - :preface (add-hook 'haskell-mode-local-vars-hook #'lsp! 'append) + :defer t + :init + (add-hook 'haskell-mode-local-vars-hook #'lsp! 'append) + (add-hook 'haskell-literate-mode-local-vars-hook #'lsp! 'append) + (after! lsp-mode (require 'lsp-haskell)) :config ;; Does some strange indentation if it pastes in the snippet (setq-hook! 'haskell-mode-hook yas-indent-line 'fixed))