Skip to content

The one and only agent harness for complex codebases. Project memory, planning, execution, and verified completion inside Codex.

2.3 KB
Raw Blame

Haskell — LSP setup

  • Builtin server: haskell-language-server — haskell-language-server-wrapper --lsp
  • Extensions: .hs .lhs
  • Install hint: ghcup install hls

The -wrapper binary detects your project's GHC version and dispatches to the matching HLS build.

Install

  • macOS: ghcup install hls (install ghcup via brew install ghcup or the official script)
  • Linux: ghcup install hls (ghcup script from https://www.haskell.org/ghcup/)
  • Windows: ghcup install hls (ghcup is installed via the Windows installer / PowerShell bootstrap)

HLS needs a working GHC plus Cabal and/or Stack. Install a matching toolchain first:

ghcup install ghc
ghcup install cabal

Confirm it resolves:

command -v haskell-language-server-wrapper

Configure

Builtin — usually NO config needed (auto-resolved by extension). Configure only to set priority, init options, override extensions, or disable. Same JSON shape in every harness's project config (per-harness paths: the Configure step in SKILL.md):

{ "lsp": { "haskell-language-server": { "priority": 100 } } }

For builtin ids in a PROJECT config, command is supplied automatically — only set priority/initialization/extensions/disabled (a project entry drops env). env, and a fully custom (non-builtin) server with its own command, must go in your harness's USER config (see the Configure step in SKILL.md).

Initialization options (only if commonly needed)

None commonly required. Per-project plugin/formatter settings normally live in a hie.yaml (cradle) and .haskell-language-server files rather than init options.

Alternatives

  • ghcide (the core HLS engine, standalone) — largely superseded by HLS.
  • hlint standalone for lint-only checks; ormolu/fourmolu for formatting.

Troubleshooting

  • PATH: haskell-language-server-wrapper on PATH; reopen shell after ghcup install.
  • GHC mismatch: the installed HLS must support your project's GHC version — run ghcup install hls for that GHC, or align GHC to a supported one.
  • No cradle: multi-package repos may need a hie.yaml; generate one with gen-hie > hie.yaml.
  • Slow first load: HLS compiles dependencies on first open; let it finish indexing.

Verify

bun ../../scripts/verify-lsp.ts path/to/file.hs