fix(haskell): lsp activation w/ treesit & eglot

Fixed an issue where eglot wouldn't activate if lsp-haskell was disabled
or the user had +tree-sitter enabled.

Fix: #8528
This commit is contained in:
Henrik Lissner 2025-12-02 21:13:35 -05:00
parent f727456a27
commit 15db7620e4
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -28,6 +28,10 @@
#'haskell-collapse-mode ; support folding haskell code blocks #'haskell-collapse-mode ; support folding haskell code blocks
#'interactive-haskell-mode) #'interactive-haskell-mode)
(when (modulep! +lsp)
(add-hook 'haskell-mode-local-vars-hook #'lsp! 'append)
(add-hook 'haskell-literate-mode-local-vars-hook #'lsp! 'append))
(add-to-list 'completion-ignored-extensions ".hi") (add-to-list 'completion-ignored-extensions ".hi")
(map! :map haskell-mode-map (map! :map haskell-mode-map
@ -52,15 +56,14 @@
'((haskell :url "https://github.com/tree-sitter/tree-sitter-haskell"))) '((haskell :url "https://github.com/tree-sitter/tree-sitter-haskell")))
:config :config
(set-repl-handler! 'haskell-ts-mode #'run-haskell :persist t) (set-repl-handler! 'haskell-ts-mode #'run-haskell :persist t)
(set-eglot-client! 'haskell-ts-mode '("haskell-language-server-wrapper" "--lsp"))) (set-eglot-client! 'haskell-ts-mode '("haskell-language-server-wrapper" "--lsp"))
(when (modulep! +lsp)
(add-hook 'haskell-ts-mode-local-vars-hook #'lsp! 'append)))
(use-package! lsp-haskell (use-package! lsp-haskell
:when (modulep! +lsp) :when (modulep! +lsp)
:defer t :defer t
:init
(add-hook 'haskell-mode-local-vars-hook #'lsp! 'append)
(add-hook 'haskell-literate-mode-local-vars-hook #'lsp! 'append)
:config :config
;; Does some strange indentation if it pastes in the snippet ;; Does some strange indentation if it pastes in the snippet
(setq-hook! 'haskell-mode-hook yas-indent-line 'fixed)) (setq-hook! 'haskell-mode-hook yas-indent-line 'fixed))