Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add emacs/doom-emacs integration sub-section #115

Merged
merged 3 commits into from
May 18, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ This is *very* early stage software.
- [Install via cabal](#install-via-cabal)
- [Install specific GHC Version](#install-specific-ghc-version)
- [Project Configuration](#project-configuration)
- [Editor Integration](#editor-integration)
- [Contributing](#contributing)
- [It's time to join the project!](#its-time-to-join-the-project)

Expand Down Expand Up @@ -267,6 +268,56 @@ dependencies:
- someDep
```

## Editor Integration

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.

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 on linux and macOS).
fendor marked this conversation as resolved.
Show resolved Hide resolved

### Using haskell-language-server with Emacs

Install HLS along with the following emacs packages:

[lsp-mode](https://github.com/emacs-lsp/lsp-mode)
[lsp-ui](https://github.com/emacs-lsp/lsp-ui)
[lsp-haskell](https://github.com/emacs-lsp/lsp-haskell)

Make sure to follow the instructions in the README of each of these packages.

``` emacs-lisp
(use-package lsp-haskell
:ensure t
:config
(setq lsp-haskell-process-path-hie "haskell-language-server-wrapper")
;; Comment/uncomment this line to see interactions between lsp client/server.
;;(setq lsp-log-io t)
)
```



### Using haskell-language-server with [doom-emacs](https://github.com/hlissner/doom-emacs/tree/develop/modules/lang/haskell#module-flags)

Install HLS, and then enable haskell lang module with lsp flag in `.doom.d/init.el`
``` emacs-lisp
:lang
(haskell +lsp)
```

in your `.doom.d/config.el` file

``` emacs-lisp
(use-package lsp-haskell
:ensure t
:config
(setq lsp-haskell-process-path-hie "haskell-language-server-wrapper")
;; Comment/uncomment this line to see interactions between lsp client/server.
;;(setq lsp-log-io t)
)
```

then do `$HOME/.emacs.d/bin/doom refresh`

## Contributing

### It's time to join the project!
Expand Down