The official Haskell language server (LSP) implementation
open sourceApache-2.0free
Haskell Language Server (HLS) is the official Language Server Protocol server for Haskell, giving any LSP editor GHC's errors and warnings, hovers, go to definition and references, completions, formatting, rename, call hierarchy and semantic tokens. Plugins add HLint and Stan hints, code actions (missing pragmas, explicit import lists, missing class methods, adding a dependency to the cabal file) and code lenses that add type signatures or evaluate snippets in comments. It's built on ghcide, its core library for building Haskell IDE tooling on the GHC API, and is usually installed with GHCup.
Ways to install
Package managers
Problems it solves
- get autocomplete and type errors for Haskell in VS Code or Neovim
- see the type of a Haskell expression by hovering over it in my editor
- apply HLint suggestions automatically while I edit Haskell
- build my own Haskell IDE tool on top of the GHC API
Features
- GHC diagnostics, HLint and Stan hints
- hover, go to definition, type definition and implementation, find references
- completions, formatting, rename, call hierarchy, semantic tokens
- code actions and code lenses, including evaluating snippets in comments
- plugin API (hls-plugin-api) for writing new plugins
- ghcide, the core library, usable to build other Haskell IDE tooling
Alternatives
The same job
These do what Haskell Language Server does.
- Lua Language Server A language server for Lua with type checking, completion and diagnostics, written in Lua
- Pyrefly A fast type checker and language server for Python, written in Rust
- TypeScript Language Server Language Server Protocol wrapper around TypeScript's tsserver
- Eclipse JDT Language Server A Java language server that works with any editor speaking the Language Server Protocol
- Metals Scala language server with rich IDE features
- Intelephense Code intelligence for productive PHP developers