diff --git a/README.md b/README.md index 79726ef334..20a55d6e1a 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,9 @@ 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) + - [With emacs](#using-haskell-language-server-with-emacs) + - [With doom emacs](#using-haskell-language-server-with-doom-emacs) - [Contributing](#contributing) - [It's time to join the project!](#its-time-to-join-the-project) @@ -267,6 +270,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` or `~/.cabal/bin` on linux and macOS). + +### 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 haskell-language-server, 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!