From 239e6ffad647772619caedce3e2267018452ddd5 Mon Sep 17 00:00:00 2001 From: Yuan Wang Date: Sun, 17 May 2020 13:30:44 -0600 Subject: [PATCH 1/3] add editor integration section --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/README.md b/README.md index 79726ef334..6f336c8057 100644 --- a/README.md +++ b/README.md @@ -267,6 +267,46 @@ 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 hie executable. + +All of the editor integrations assume that you have already installed HLS (see above) and that stack put the hls binary in your path (usually ~/.local/bin on linux and macOS). + +### Using HLS 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. + +``` lisp +(setq lsp-haskell-process-path-hie "haskell-language-server-wrapper") +``` + + + +### Using HLS 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 +(after! lsp-haskell + (setq lsp-haskell-process-path-hie "haskell-language-server-wrapper") +) +``` + +then do `$HOME/.emacs.d/bin/doom refresh` + ## Contributing ### It's time to join the project! From f9d8b357f9e0cca904f0c62ec4b93cfd0706497b Mon Sep 17 00:00:00 2001 From: Yuan Wang Date: Sun, 17 May 2020 21:37:02 -0600 Subject: [PATCH 2/3] address code review feedback --- README.md | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6f336c8057..950b42e010 100644 --- a/README.md +++ b/README.md @@ -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) @@ -269,11 +270,11 @@ dependencies: ## 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 hie executable. +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 HLS (see above) and that stack put the hls binary in your path (usually ~/.local/bin on linux and macOS). +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). -### Using HLS with Emacs +### Using haskell-language-server with Emacs Install HLS along with the following emacs packages: @@ -283,13 +284,19 @@ Install HLS along with the following emacs packages: Make sure to follow the instructions in the README of each of these packages. -``` lisp -(setq lsp-haskell-process-path-hie "haskell-language-server-wrapper") +``` 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 HLS with [doom-emacs](https://github.com/hlissner/doom-emacs/tree/develop/modules/lang/haskell#module-flags) +### 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 @@ -300,8 +307,12 @@ Install HLS, and then enable haskell lang module with lsp flag in `.doom.d/init. in your `.doom.d/config.el` file ``` emacs-lisp -(after! lsp-haskell - (setq lsp-haskell-process-path-hie "haskell-language-server-wrapper") +(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) ) ``` From d42996e100534e8d98dc2070ea05f1bd1f8cfce8 Mon Sep 17 00:00:00 2001 From: Yuan Wang Date: Mon, 18 May 2020 10:52:39 -0600 Subject: [PATCH 3/3] address code review feedback --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 950b42e010..20a55d6e1a 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ This is *very* early stage software. - [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) @@ -272,7 +274,7 @@ dependencies: 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). +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 @@ -298,7 +300,7 @@ Make sure to follow the instructions in the README of each of these packages. ### 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` +Install haskell-language-server, and then enable haskell lang module with lsp flag in `.doom.d/init.el` ``` emacs-lisp :lang (haskell +lsp)