Skip to content

lsp-haskell#

MELPA Build Status

An Emacs Lisp library for interacting with a Haskell language server such as haskell-language-server or ghcide using Microsoft's Language Server Protocol.

The library acts as a client for lsp-mode.

Emacs Configuration#

Install lsp-mode first, and either clone this repository, or install from MELPA. Add the following to your .emacs:

(require 'lsp)
(require 'lsp-haskell)
;; Hooks so haskell and literate haskell major modes trigger LSP setup
(add-hook 'haskell-mode-hook #'lsp)
(add-hook 'haskell-literate-mode-hook #'lsp)

Note: All three packages are also available via MELPA.

It needs the Haskell language server that you plan to use in your path, so follow the appropriate OSX or Linux section below accordingly.

Language server installation#

Follow the instructions on the haskell-language-server or ghcide repositories to install your server of choice.

If you have installed a server other than haskell-language-server, make sure to customize the lsp-haskell-server-path variable to point to the executable you have installed (see below).

Server configuration#

lsp-haskell exposes a number of configuration options under the lsp-haskell customization group, which should be set like normal customization variables. Use M-x customize-group to get started.

This includes a few options for for setting the server executable and arguments, and numerous settings for configuring the server itself (hlint, choice of formatting provider, etc.).

Note that server configuration settings will currently not be applied until the server is restarted.


Last update: September 24, 2020