Open FichteFoll opened 7 months ago
Note that this also applies to the response after a rename request:
:: [14:34:16.154] --> haskell-language-server textDocument/rename (138): {'newName': 'part30', 'workDoneToken': '$ublime-work-done-progress-138', 'textDocument': {'uri': 'file:///home/mhm/code/advent-of-code/2023/haskell/day01/Main.hs'}, 'position': {'line': 42, 'character': 3}}
:: [14:34:16.193] <<< haskell-language-server (138) (duration: 38ms): {'documentChanges': [{'textDocument': {'uri': 'file:///home/mhm/code/advent-of-code/2023/haskell/day01/Main.hs', 'version': 0}, 'edits': [{'range': {'start': {'character': 0, 'line': 42}, 'end': {'character': 58, 'line': 42}}, 'newText': 'part30 = sum . map ((liftA2 (+) fst last) . filter isDigit)'}]}]}
I'm surprised this isn't a bigger problem, tbh.
I think VSCode (or rather the integration inside of it) just ignores the version. I also added a local change to the Sublime Text LSP package to ignore the version when it is 0
to work around this issue, but that is obviously not desirable.
Your environment
Which OS do you use? ArchLinux Which version of GHC do you use and how did you install it? 9.0.2 via Arch repositories How is your project built (alternative: link to the project)? Just a file.
Which LSP client (editor/plugin) do you use? Sublime Text's LSP package (as documented) Which version of HLS do you use and how did you install it?
Have you configured HLS in any way (especially: a
hie.yaml
file)? No.Steps to reproduce
https://github.com/sublimelsp/LSP/issues/2368 Basically request a code action, e.g. for the code
part1 = sum . map (liftA2 (+) fst last . filter isDigit)
.Prompting to rename a variable also uses the wrong version.
Expected behaviour
The resulting
workspace/applyEdit
should either have the correct version set or none.Actual behaviour
The version in the resulting
workspace/applyEdit
is always0
and the SublimeText LSP package rejects the edit because of a version mis-match.Debug information
(via https://github.com/sublimelsp/LSP/issues/2368)