summaryrefslogtreecommitdiff
path: root/.emacs
diff options
context:
space:
mode:
authorArnaud Bailly <arnaud.oqube@gmail.com>2021-02-02 09:42:24 +0000
committerArnaud Bailly <arnaud.oqube@gmail.com>2021-02-02 09:42:24 +0000
commit701cf605ff9a10d665eddbf826216a71681326f7 (patch)
tree0d672fda58f90195c8e663154efbc68592a2c89b /.emacs
parent0ac0470525216b21564c1ff31d79357734b977b2 (diff)
downloaddotfiles-701cf605ff9a10d665eddbf826216a71681326f7.tar.gz
improve configuration of lsp-mode for haskell
seems like 'lsp' is not the right package to use, switched to lsp-mode and use deferred to give time to nix-shell to do its magic
Diffstat (limited to '.emacs')
-rw-r--r--.emacs13
1 files changed, 9 insertions, 4 deletions
diff --git a/.emacs b/.emacs
index 6cde332..033d72f 100644
--- a/.emacs
+++ b/.emacs
@@ -315,13 +315,18 @@
:after (haskell-mode yasnippet)
:defer)
-(use-package lsp
- :ensure t)
+(use-package lsp-mode
+ :ensure t
+ ;; we need to defer running lsp because in case there's a direnv
+ ;; with use nix, it takes some time to load and lsp won't find the
+ ;; language server until the env is setup properly
+ :hook ((haskell-mode . lsp-deferred))
+ :commands (lsp lsp-deferred))
+
(use-package lsp-haskell
:ensure t)
-(add-hook 'haskell-mode-hook #'lsp-mode)
-(setq lsp-log-io 't)
+(setq lsp-log-io 't)
;; optionally
;; (use-package lsp-ui :commands lsp-ui-mode)