From 49e9cb350bf8026a6b19972e86953250ef9e5d8f Mon Sep 17 00:00:00 2001 From: Raymond Baker Date: Wed, 15 Oct 2025 12:42:12 -0600 Subject: [PATCH] update contributing.md, adding instructions for configuring eglot to use a hacked HLS executable. --- docs/contributing/contributing.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/contributing/contributing.md b/docs/contributing/contributing.md index 08ad21f12e..12df04b43a 100644 --- a/docs/contributing/contributing.md +++ b/docs/contributing/contributing.md @@ -159,7 +159,7 @@ When using VS Code you can set up each project to use a specific HLS executable: ``` #### Configuring Emacs -There are several ways to configure the HLS server path: +There are several ways to configure the HLS server path, each of which depends on your choice of language server provider (e.g., emacs-lsp or eglot). If using emacs-lsp, you need to configure the variable `lsp-haskell-server-path`: - `M-x customize-grouplsp-haskellLsp Haskell Server Path` - Evaluate `(setq lsp-haskell-server-path "/path/to/your/hacked/haskell-language-server")` - Create a file `.dir-locals.el` with the following content: @@ -167,6 +167,13 @@ There are several ways to configure the HLS server path: ((haskell-mode . ((lsp-haskell-server-path . "/path/to/your/hacked/haskell-language-server")))) ``` +If using eglot, you need to configure the variable `eglot-server-programs`, which is an alist associating major-modes to executables: +- Evaluate `(setf (alist-get 'haskell-mode eglot-server-programs) ("/path/to/your/hacked/haskell-language-server" "--lsp"))` +- Create a file `.dir-locals.el` with the following content: +```lisp +((haskell-mode . ((eglot-server-programs . (('haskell-mode . ("/path/to/your/hacked/haskell-language-server" "--lsp"))))))) +``` + ### Rebuild HLS - With Stack: `stack build haskell-language-server:exe:haskell-language-server` - With Cabal: `cabal build exe:haskell-language-server`