diff --git a/core/core-modules.el b/core/core-modules.el index a1fe7b365..72cc61f7f 100644 --- a/core/core-modules.el +++ b/core/core-modules.el @@ -172,7 +172,7 @@ following properties: :path [STRING] path to category root directory Example: - (doom-module-set :lang 'haskell :flags '(+dante))" + (doom-module-set :lang 'haskell :flags '(+lsp))" (puthash (cons category module) plist doom-modules)) (defun doom-module-path (category module &optional file) diff --git a/docs/modules.org b/docs/modules.org index 3ecfd48c5..33b2bdbf4 100644 --- a/docs/modules.org +++ b/docs/modules.org @@ -117,7 +117,7 @@ Modules that bring support for a language or group of languages to Emacs. + [[file:../modules/lang/fstar/README.org][fstar]] - F* support + [[file:../modules/lang/gdscript/README.org][gdscript]] =+lsp= - TODO + [[file:../modules/lang/go/README.org][go]] =+lsp= - TODO -+ [[file:../modules/lang/haskell/README.org][haskell]] =+dante +lsp= - TODO ++ [[file:../modules/lang/haskell/README.org][haskell]] =+lsp= - TODO + hy - TODO + [[file:../modules/lang/idris/README.org][idris]] - TODO + java =+meghanada +eclim +lsp= - TODO diff --git a/init.example.el b/init.example.el index 9045f290b..4d42f7fcf 100644 --- a/init.example.el +++ b/init.example.el @@ -132,7 +132,7 @@ ;;fstar ; (dependent) types and (monadic) effects and Z3 ;;gdscript ; the language you waited for ;;(go +lsp) ; the hipster dialect - ;;(haskell +dante) ; a language that's lazier than I am + ;;(haskell +lsp) ; a language that's lazier than I am ;;hy ; readability of scheme w/ speed of python ;;idris ; a language you can depend on ;;json ; At least it ain't XML diff --git a/modules/lang/haskell/+dante.el b/modules/lang/haskell/+dante.el deleted file mode 100644 index 2683abd8c..000000000 --- a/modules/lang/haskell/+dante.el +++ /dev/null @@ -1,41 +0,0 @@ -;;; lang/haskell/+dante.el -*- lexical-binding: t; -*- -;;;###if (featurep! +dante) - -(use-package! dante - :hook (haskell-mode-local-vars . dante-mode) - :init - (setq dante-load-flags '(;; defaults: - "+c" - "-Wwarn=missing-home-modules" - "-fno-diagnostics-show-caret" - ;; necessary to make attrap-attrap useful: - "-Wall" - ;; necessary to make company completion useful: - "-fdefer-typed-holes" - "-fdefer-type-errors")) - :config - (when (featurep! :checkers syntax) - (flycheck-add-next-checker 'haskell-dante '(warning . haskell-hlint))) - - (set-company-backend! 'dante-mode #'dante-company) - - (defadvice! +haskell--restore-modified-state-a (fn &rest args) - "Marks the buffer as falsely modified. -Dante quietly saves the current buffer (without triggering save hooks) before -invoking flycheck, unexpectedly leaving the buffer in an unmodified state. This -is annoying if we depend on save hooks to do work on the buffer (like -reformatting)." - :around #'dante-async-load-current-buffer - (let ((modified-p (buffer-modified-p))) - (apply fn args) - (if modified-p (set-buffer-modified-p t)))) - - (when (featurep 'evil) - (add-hook 'dante-mode-hook #'evil-normalize-keymaps)) - (map! :map dante-mode-map - :localleader - "t" #'dante-type-at - "i" #'dante-info - "l" #'haskell-process-load-file - "e" #'dante-eval-block - "a" #'attrap-attrap)) diff --git a/modules/lang/haskell/README.org b/modules/lang/haskell/README.org index 0fa683fa0..c678b86d7 100644 --- a/modules/lang/haskell/README.org +++ b/modules/lang/haskell/README.org @@ -18,15 +18,13 @@ - [[#troubleshooting][Troubleshooting]] * Description -This module adds [[https://www.haskell.org/][Haskell]] support, powered by either [[https://github.com/jyp/dante][dante]] (the default) or LSP +This module adds [[https://www.haskell.org/][Haskell]] support, powered by LSP (haskell-language-server). + Code completion (~company-ghc~) + Look up documentation (~hoogle~) -+ eldoc support (~dante~) + REPL (~ghci~) + Syntax-checking (~flycheck~) -+ Code navigation (~dante~) + [[https://github.com/hlissner/doom-snippets/tree/master/haskell-mode][Snippets]] ** External resources @@ -38,31 +36,19 @@ Here are a few resources I've found indispensable in my Haskell adventures: + [[https://docs.haskellstack.org/en/stable/README/][The Haskell Tool Stack docs]] ** Module Flags -+ =+dante= Enables dante; a fork of intero aimed at lightweightedness. It - doesn't depend on =stack=, supports both ~cabal~-only and ~stack~ projects, - but lacks eldoc support. + =+lsp= Enables LSP support with haskell-language-server (requires the ~:tools lsp~ module). ** Plugins + [[https://github.com/haskell/haskell-mode][haskell-mode]] -+ =+dante= - + [[https://github.com/jyp/dante][dante]] - + [[https://github.com/jyp/attrap][attrap]] + =+lsp= + [[https://github.com/emacs-lsp/lsp-haskell][lsp-haskell]] * Prerequisites -Depending on whether you use Dante or haskell-language-server, your -dependencies will differ: -+ Dante users need =cabal=, =ghc= and =ghc-mod= + LSP users need the =haskell-language-server= LSP server + All users will need the =hoogle= package ** Cabal -To use Dante, you need =cabal= (the haskell package builder) and =ghci= (the -compiler, syntax checker & repl): - *** MacOS #+BEGIN_SRC sh brew install cabal-install ghc @@ -112,12 +98,6 @@ stack setup ** Haskell packages You'll need to install the following packages using ~stack~ or ~cabal~: -+ (Dante users) =ghc-mod= - #+BEGIN_SRC sh - stack install ghc-mod - # or - cabal install ghc-mod - #+END_SRC + =hoogle= #+BEGIN_SRC sh cabal update diff --git a/modules/lang/haskell/config.el b/modules/lang/haskell/config.el index 63688e651..a2681b46b 100644 --- a/modules/lang/haskell/config.el +++ b/modules/lang/haskell/config.el @@ -46,5 +46,4 @@ ;; ;;; Backends -(cond ((featurep! +dante) (load! "+dante")) - ((featurep! +lsp) (load! "+lsp"))) +(when (featurep! +lsp) (load! "+lsp")) diff --git a/modules/lang/haskell/doctor.el b/modules/lang/haskell/doctor.el index 088490cf9..d4d89a6fc 100644 --- a/modules/lang/haskell/doctor.el +++ b/modules/lang/haskell/doctor.el @@ -5,8 +5,7 @@ (featurep! :tools lsp)) "This module requires (:tools lsp)") -(when (featurep! +dante) - (unless (executable-find "cabal") - (warn! "Couldn't find cabal, haskell-mode may have issues")) - (unless (executable-find "hlint") - (warn! "Couldn't find hlint. Flycheck may have issues in haskell-mode"))) +(unless (executable-find "cabal") + (warn! "Couldn't find cabal, haskell-mode may have issues")) +(unless (executable-find "hlint") + (warn! "Couldn't find hlint. Flycheck may have issues in haskell-mode")) diff --git a/modules/lang/haskell/packages.el b/modules/lang/haskell/packages.el index 3c1b5fad9..4829d5a6d 100644 --- a/modules/lang/haskell/packages.el +++ b/modules/lang/haskell/packages.el @@ -3,9 +3,6 @@ (package! haskell-mode :pin "98ba3922360199d5260d47f417f096730ad057c5") -(when (featurep! +dante) - (package! dante :pin "8741419333fb85ed2c1d71f5902688f5201b0a40") - (package! attrap :pin "a5bc695af27349ae6fe4541a581e6fd449d2a026")) (when (and (featurep! +lsp) (not (featurep! :tools lsp +eglot))) (package! lsp-haskell :pin "4e62cf897dd9e9fcef25c6e8e483490a07a5d439"))