diff --git a/modules/lang/haskell/config.el b/modules/lang/haskell/config.el index 9c78fbced..0bbc03eeb 100644 --- a/modules/lang/haskell/config.el +++ b/modules/lang/haskell/config.el @@ -28,9 +28,6 @@ #'haskell-collapse-mode ; support folding haskell code blocks #'interactive-haskell-mode) - (when (modulep! +tree-sitter) - (add-hook 'haskell-mode-local-vars-hook #'tree-sitter! 'append)) - (add-to-list 'completion-ignored-extensions ".hi") (map! :map haskell-mode-map @@ -47,6 +44,16 @@ "H" #'haskell-hide-toggle-all)) +;; TODO: Mirror other haskell-mode config to ts-mode +(use-package! haskell-ts-mode + :when (modulep! +tree-sitter) + :when (fboundp 'haskell-ts-mode) + :defer t + :init + (set-tree-sitter! 'haskell-mode 'haskell-ts-mode + '((haskell :url "https://github.com/tree-sitter/tree-sitter-haskell")))) + + (use-package! lsp-haskell :when (modulep! +lsp) :defer t diff --git a/modules/lang/haskell/doctor.el b/modules/lang/haskell/doctor.el index 8874330f5..7ffc55058 100644 --- a/modules/lang/haskell/doctor.el +++ b/modules/lang/haskell/doctor.el @@ -5,6 +5,10 @@ (modulep! :tools lsp)) "This module requires (:tools lsp)") +(assert! (or (not (modulep! +tree-sitter)) + (modulep! :tools tree-sitter)) + "This module requires (:tools tree-sitter)") + (unless (executable-find "cabal") (warn! "Couldn't find cabal. haskell-mode may have issues.")) diff --git a/modules/lang/haskell/packages.el b/modules/lang/haskell/packages.el index 8ba6491bd..0feac9687 100644 --- a/modules/lang/haskell/packages.el +++ b/modules/lang/haskell/packages.el @@ -2,6 +2,8 @@ ;;; lang/haskell/packages.el (package! haskell-mode :pin "e9c356739310332afe59b10ffa2e6c3e76f124e3") +(when (modulep! +tree-sitter) + (package! haskell-ts-mode :pin "b47211699944997bfb03fd88b1157dd71727bad7")) (when (and (modulep! +lsp) (modulep! :tools lsp -eglot))