Skip to content

Commit 144457f

Browse files
authored
Merge pull request #115 from yuanw/doom-emacs-doc
Add emacs/doom-emacs integration sub-section
2 parents 50bcce4 + d42996e commit 144457f

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ This is *very* early stage software.
2525
- [Install via cabal](#install-via-cabal)
2626
- [Install specific GHC Version](#install-specific-ghc-version)
2727
- [Project Configuration](#project-configuration)
28+
- [Editor Integration](#editor-integration)
29+
- [With emacs](#using-haskell-language-server-with-emacs)
30+
- [With doom emacs](#using-haskell-language-server-with-doom-emacs)
2831
- [Contributing](#contributing)
2932
- [It's time to join the project!](#its-time-to-join-the-project)
3033

@@ -267,6 +270,56 @@ dependencies:
267270
- someDep
268271
```
269272

273+
## Editor Integration
274+
275+
Note to editor integrators: there is now a haskell-language-server-wrapper executable, which is installed alongside the haskell-language-server executable. When this is invoked in the project root directory, it attempts to work out the GHC version used in the project, and then launch the matching haskell-language-server executable.
276+
277+
All of the editor integrations assume that you have already installed haskell-language-server (see above) and that the installation script put the haskell-language-server binary in your path (usually `~/.local/bin` or `~/.cabal/bin` on linux and macOS).
278+
279+
### Using haskell-language-server with Emacs
280+
281+
Install HLS along with the following emacs packages:
282+
283+
[lsp-mode](https://github.com/emacs-lsp/lsp-mode)
284+
[lsp-ui](https://github.com/emacs-lsp/lsp-ui)
285+
[lsp-haskell](https://github.com/emacs-lsp/lsp-haskell)
286+
287+
Make sure to follow the instructions in the README of each of these packages.
288+
289+
``` emacs-lisp
290+
(use-package lsp-haskell
291+
:ensure t
292+
:config
293+
(setq lsp-haskell-process-path-hie "haskell-language-server-wrapper")
294+
;; Comment/uncomment this line to see interactions between lsp client/server.
295+
;;(setq lsp-log-io t)
296+
)
297+
```
298+
299+
300+
301+
### Using haskell-language-server with [doom-emacs](https://github.com/hlissner/doom-emacs/tree/develop/modules/lang/haskell#module-flags)
302+
303+
Install haskell-language-server, and then enable haskell lang module with lsp flag in `.doom.d/init.el`
304+
``` emacs-lisp
305+
:lang
306+
(haskell +lsp)
307+
```
308+
309+
in your `.doom.d/config.el` file
310+
311+
``` emacs-lisp
312+
(use-package lsp-haskell
313+
:ensure t
314+
:config
315+
(setq lsp-haskell-process-path-hie "haskell-language-server-wrapper")
316+
;; Comment/uncomment this line to see interactions between lsp client/server.
317+
;;(setq lsp-log-io t)
318+
)
319+
```
320+
321+
then do `$HOME/.emacs.d/bin/doom refresh`
322+
270323
## Contributing
271324

272325
### It's time to join the project!

0 commit comments

Comments
 (0)