Jeremy Bi 2020-09-24 23:15:37 +08:00
parent 1456108d5b
commit 599d3929f0
4 changed files with 13 additions and 27 deletions

View file

@ -4,10 +4,8 @@
:after lsp-mode :after lsp-mode
:preface (add-hook 'haskell-mode-local-vars-hook #'lsp!) :preface (add-hook 'haskell-mode-local-vars-hook #'lsp!)
:config :config
(when IS-MAC
(setq lsp-haskell-process-path-hie "hie-wrapper"))
(when (featurep! +ghcide) (when (featurep! +ghcide)
(setq lsp-haskell-process-path-hie "ghcide" (setq lsp-haskell-server-path "ghcide"
lsp-haskell-process-args-hie nil)) lsp-haskell-server-args nil))
;; 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))

View file

@ -10,7 +10,7 @@
- [[#plugins][Plugins]] - [[#plugins][Plugins]]
- [[#prerequisites][Prerequisites]] - [[#prerequisites][Prerequisites]]
- [[#cabal][Cabal]] - [[#cabal][Cabal]]
- [[#lsp-haskell-ide-engine][LSP (haskell-ide-engine)]] - [[#lsp-haskell-language-server][LSP (haskell-language-server)]]
- [[#lsp-ghcide][LSP (ghcide)]] - [[#lsp-ghcide][LSP (ghcide)]]
- [[#stack][Stack]] - [[#stack][Stack]]
- [[#haskell-packages][Haskell packages]] - [[#haskell-packages][Haskell packages]]
@ -43,7 +43,7 @@ Here are a few resources I've found indispensable in my Haskell adventures:
doesn't depend on =stack=, supports both ~cabal~-only and ~stack~ projects, doesn't depend on =stack=, supports both ~cabal~-only and ~stack~ projects,
but lacks eldoc support. but lacks eldoc support.
+ =+ghcide= Enables LSP support with ghcide (requires the ~:tools lsp~ module). + =+ghcide= Enables LSP support with ghcide (requires the ~:tools lsp~ module).
+ =+lsp= Enables LSP support with haskell-ide-engine (requires the ~:tools lsp~ + =+lsp= Enables LSP support with haskell-language-server (requires the ~:tools lsp~
module). module).
** Plugins ** Plugins
@ -59,7 +59,7 @@ Depending on whether you use Dante, haskell-language-server or ghcide, your
dependencies will differ: dependencies will differ:
+ Dante users need =cabal=, =ghc= and =ghc-mod= + Dante users need =cabal=, =ghc= and =ghc-mod=
+ LSP users need the =haskell-ide-engine= LSP server OR =ghcide= + LSP users need the =haskell-language-server= LSP server OR =ghcide=
+ All users will need the =hoogle= package + All users will need the =hoogle= package
** Cabal ** Cabal
@ -81,27 +81,15 @@ sudo pacman -S cabal-install ghc
sudo zypper install cabal-install ghc sudo zypper install cabal-install ghc
#+END_SRC #+END_SRC
** LSP (haskell-ide-engine) ** LSP (haskell-language-server)
You will need =stack= and =git= installed. You will need =stack= and =git= installed.
You will find a comprehensive [[https://github.com/haskell/haskell-ide-engine#installation][install guide for haskell-ide-engine on its You will find a comprehensive [[https://github.com/haskell/haskell-language-server#installation][instructions for haskell-language-server on its project page]], but if you are using [[https://www.haskell.org/ghcup/][ghcup]]:
project page]], but here's a TL;DR:
*** MacOS
haskell-ide-engine must be build and installed manually on MacOS, e.g.
#+BEGIN_SRC bash #+BEGIN_SRC bash
git clone https://github.com/haskell/haskell-ide-engine ghcup install hls
cd haskell-ide-engine
make
#+END_SRC #+END_SRC
*** Arch Linux
=haskell-ide-engine-git= is available on the AUR
#+BEGIN_SRC bash
yay -S haskell-ide-engine-git
#+END_SRC
** LSP (ghcide) ** LSP (ghcide)
See https://github.com/digital-asset/ghcide for install instructions. See https://github.com/digital-asset/ghcide for install instructions.

View file

@ -1,12 +1,12 @@
;; -*- no-byte-compile: t; -*- ;; -*- no-byte-compile: t; -*-
;;; lang/haskell/packages.el ;;; lang/haskell/packages.el
(package! haskell-mode :pin "41683c0e634bb3f54eac8747919a82132e1714fe") (package! haskell-mode :pin "e72677668f5fc7cc148008e885a0f256e245dd43")
(when (featurep! +dante) (when (featurep! +dante)
(package! dante :pin "c516bc9e8f09e0f928de9a93e82acfb382636f5c") (package! dante :pin "e2acbf6dd37818cbf479c9c3503d8a59192e34af")
(package! attrap :pin "4cf3e4a16255997e7c3c39682a72866a0a37dd4b")) (package! attrap :pin "9c881548debcf59b8aadda0ef4abca3c9a68dd80"))
(when (or (and (featurep! +lsp) (when (or (and (featurep! +lsp)
(not (featurep! :tools lsp +eglot))) (not (featurep! :tools lsp +eglot)))
(featurep! +ghcide)) (featurep! +ghcide))
(package! lsp-haskell :pin "17d7d4c6615b5e6c7442828720730bfeda644af8")) (package! lsp-haskell :pin "a56667b496e5370f1a50310589a2d2a4d3b9d11e"))

View file

@ -43,7 +43,7 @@ As of this writing, this is the state of LSP support in Doom Emacs:
| [[../../lang/elixir/README.org][:lang elixir]] | elixir-mode | elixir-ls | | [[../../lang/elixir/README.org][:lang elixir]] | elixir-mode | elixir-ls |
| [[../../lang/fsharp/README.org][:lang fsharp]] | fsharp-mode | Mono, .NET core | | [[../../lang/fsharp/README.org][:lang fsharp]] | fsharp-mode | Mono, .NET core |
| [[../../lang/go/README.org][:lang go]] | go-mode | go-langserver | | [[../../lang/go/README.org][:lang go]] | go-mode | go-langserver |
| [[../../lang/haskell/README.org][:lang haskell]] | haskell-mode | haskell-ide-engine | | [[../../lang/haskell/README.org][:lang haskell]] | haskell-mode | haskell-language-server |
| [[../../lang/java/README.org][:lang java]] | java-mode | lsp-java | | [[../../lang/java/README.org][:lang java]] | java-mode | lsp-java |
| [[../../lang/javascript/README.org][:lang javascript]] | js2-mode, rjsx-mode, typescript-mode | typescript-language-server | | [[../../lang/javascript/README.org][:lang javascript]] | js2-mode, rjsx-mode, typescript-mode | typescript-language-server |
| [[../../lang/ocaml/README.org][:lang ocaml]] | tuareg-mode | ocaml-language-server | | [[../../lang/ocaml/README.org][:lang ocaml]] | tuareg-mode | ocaml-language-server |