haskell / haskell/haskell-language-server
Record fields completion seems to be broken in HLS 2.12.0.0.
- Dominant language
- Haskell
- Stars
- 3k
- Forks
- 455
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 12
Description
### Your environment
Which OS do you use?
Ubuntu 22.04 in WSL2.
Which version of GHC do you use and how did you install it?
9.6.7 installed from ghcup with vanilla channel.
How is your project built (alternative: link to the project)?
`cabal build`
Which LSP client (editor/plugin) do you use?
Neovim with its builtin lsp client.
Which version of HLS do you use and how did you install it?
2.12.0.0 and 2.11.0.0, both installed from ghcup with vanilla channel.
Have you configured HLS in any way (especially: a `hie.yaml` file)?
No `hie.yaml` file, HLS is configured with:
```lua
settings =
{ haskell =
{ plugin =
{ ["ghcide-completions"] =
{ config =
{ snippetsOn = false
, autoExtendOn = false
}
}
, semanticTokens = { globalOn = true }
}
, maxCompletions = 100
, sessionLoading = "multipleComponents"
, formattingProvider = "stylish-haskell"
, cabalFormattingProvider = "cabalfmt"
}
}
```
### Steps to reproduce
1. Create a new empty project.
2. Paste the codes below into Main.hs.
```haskell
{-# LANGUAGE OverloadedRecordDot #-}
module Main where
data User
= User
{ name :: String
, level :: Int
}
deriving (Show)
main :: IO ()
main = do
let
user = User "Lutz" 1
print user
```
3. Place the cursor right after word `user` of the last line, and press dot, there are no completions popped up.
### Expected behaviour
There should be completions.
### Actual behaviour
There are no completions. But if I use HLS 2.11.0.0, the completions are back.
### Debug information
Here are some lsp debug logs:
For HLS 2.11.0.0 (working):
```
[DEBUG][2026-01-14 09:15:42] .../vim/lsp/rpc.lua:277 "rpc.send" { jsonrpc = "2.0", method = "textDocument/didChange", params = { contentChanges = { { range = { ["end"] = { character = 12, line = 15 }, start = { character = 12, line = 15 } }, rangeLength = 0, text = "." } }, textDocument = { uri = "file:///home/lutz/Documents/playhs/exe/Main.hs", version = 81 } } }
[DEBUG][2026-01-14 09:15:42] ...m/lsp/client.lua:674 "LSP[hls]" "client.request" 1 "textDocument/completion" { context = { triggerCharacter = ".", triggerKind = 2 }, position = { character = 13, line = 15 }, textDocument = { uri = "file:///home/lutz/Documents/playhs/exe/Main.hs" } } 11
[DEBUG][2026-01-14 09:15:42] .../vim/lsp/rpc.lua:277 "rpc.send" { id = 78, jsonrpc = "2.0", method = "textDocument/completion", params = { context = { triggerCharacter = ".", triggerKind = 2 }, position = { character = 13, line = 15 }, textDocument = { uri = "file:///home/lutz/Documents/playhs/exe/Main.hs" } } }
[DEBUG][2026-01-14 09:15:42] .../vim/lsp/rpc.lua:391 "rpc.receive" { id = 78, jsonrpc = "2.0", result = { isIncomplete = true, items = { { detail = "from User", documentation = { kind = "markdown", value = "*Defined in 'User'*\n" }, insertTextFormat = 1, kind = 5, label = "level", sortText = "0" }, { detail = "from User", documentation = { kind = "markdown", value = "*Defined in 'User'*\n" }, insertTextFormat = 1, kind = 5, label = "name", sortText = "1" } } } }
[DEBUG][2026-01-14 09:15:42] .../vim/lsp/rpc.lua:391 "rpc.receive" { jsonrpc = "2.0", method = "textDocument/publishDiagnostics", params = { diagnostics = { { code = "GHC-58481", message = "parse error (possibly incorrect indentation or mismatched brackets)", range = { ["end"] = { character = 0, line = 16 }, start = { character = 0, line = 16 } }, severity = 1, source = "parser" } }, uri = "file:///home/lutz/Documents/playhs/exe/Main.hs", version = 81 } }
[DEBUG][2026-01-14 09:15:42] ...m/lsp/client.lua:674 "LSP[hls]" "client.request" 1 "textDocument/semanticTokens/full/delta" { previousResultId = "39", textDocument = { uri = "file:///home/lutz/Documents/playhs/exe/Main.hs" } } 11
[DEBUG][2026-01-14 09:15:42] .../vim/lsp/rpc.lua:277 "rpc.send" { id = 79, jsonrpc = "2.0", method = "textDocument/semanticTokens/full/delta", params = { previousResultId = "39", textDocument = { uri = "file:///home/lutz/Documents/playhs/exe/Main.hs" } } }
[ERROR][2026-01-14 09:15:42] ...p/_transport.lua:36 "rpc" "haskell-language-server-wrapper" "stderr" "2026-01-14T01:15:42.329392Z | Warning | semanticTokens: SemanticTokens' dependency error: Rule Failed: GetHieAst\n"
[DEBUG][2026-01-14 09:15:42] .../vim/lsp/rpc.lua:391 "rpc.receive" { id = 79, jsonrpc = "2.0", result = { edits = { { data = { 5 }, deleteCount = 1, start = 67 } }, resultId = "40" } }
```
For HLS 2.12.0.0 (broken):
```
[DEBUG][2026-01-14 09:20:01] .../vim/lsp/rpc.lua:277 "rpc.send" { jsonrpc = "2.0", method = "textDocument/didChange", params = { contentChanges = { { range = { ["end"] = { character = 12, line = 15 }, start = { character = 12, line = 15 } }, rangeLength = 0, text = "." } }, textDocument = { uri = "file:///home/lutz/Documents/playhs/exe/Main.hs", version = 6 } } }
[DEBUG][2026-01-14 09:20:01] ...m/lsp/client.lua:674 "LSP[hls]" "client.request" 1 "textDocument/completion" { context = { triggerCharacter = ".", triggerKind = 2 }, position = { character = 13, line = 15 }, textDocument = { uri = "file:///home/lutz/Documents/playhs/exe/Main.hs" } } 3
[DEBUG][2026-01-14 09:20:01] .../vim/lsp/rpc.lua:277 "rpc.send" { id = 6, jsonrpc = "2.0", method = "textDocument/completion", params = { context = { triggerCharacter = ".", triggerKind = 2 }, position = { character = 13, line = 15 }, textDocument = { uri = "file:///home/lutz/Documents/playhs/exe/Main.hs" } } }
[DEBUG][2026-01-14 09:20:01] .../vim/lsp/rpc.lua:391 "rpc.receive" { id = 6, jsonrpc = "2.0", result = { isIncomplete = true, items = {} } }
[DEBUG][2026-01-14 09:20:01] .../vim/lsp/rpc.lua:391 "rpc.receive" { jsonrpc = "2.0", method = "textDocument/publishDiagnostics", params = { diagnostics = { { code = "GHC-58481", codeDescription = { href = "https://errors.haskell.org/messages/GHC-58481" }, message = "parse error (possibly incorrect indentation or mismatched brackets)", range = { ["end"] = { character = 0, line = 16 }, start = { character = 0, line = 16 } }, severity = 1, source = "parser" } }, uri = "file:///home/lutz/Documents/playhs/exe/Main.hs", version = 6 } }
[DEBUG][2026-01-14 09:20:02] ...m/lsp/client.lua:674 "LSP[hls]" "client.request" 1 "textDocument/semanticTokens/full/delta" { previousResultId = "4", textDocument = { uri = "file:///home/lutz/Documents/playhs/exe/Main.hs" } } 3
[DEBUG][2026-01-14 09:20:02] .../vim/lsp/rpc.lua:277 "rpc.send" { id = 7, jsonrpc = "2.0", method = "textDocument/semanticTokens/full/delta", params = { previousResultId = "4", textDocument = { uri = "file:///home/lutz/Documents/playhs/exe/Main.hs" } } }
[ERROR][2026-01-14 09:20:02] ...p/_transport.lua:36 "rpc" "haskell-language-server-wrapper" "stderr" "2026-01-14T01:20:02.165089Z | Warning | semanticTokens: SemanticTokens' dependency error: Rule Failed: GetHieAst\n"
[DEBUG][2026-01-14 09:20:02] .../vim/lsp/rpc.lua:391 "rpc.receive" { id = 7, jsonrpc = "2.0", result = { edits = { { data = { 5 }, deleteCount = 1, start = 67 } }, resultId = "5" } }
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.