Open slotThe opened 2 years ago
The spec of documentChanges
said that each edit is for a different document version
/**
- Depending on the client capability
workspace.workspaceEdit.resourceOperations
document changes are either- an array of
TextDocumentEdit
s to express changes to __n different text- documents where each text document edit addresses a specific version of
- a text document__. Or it can contain above
TextDocumentEdit
s mixed with- create, rename and delete file / folder operations.,,, */
Can you try to combine your two TextDocumentEdit
into one that contains multiple edits
instead to see if it works for you?
Thank you for the bug report
lsp-mode
related packages.M-x lsp-start-plain
Bug description
@akshaymankar and I discovered this while trying to debug why a new Haskell LSP plugin wasn't working correctly. Basically, https://github.com/emacs-lsp/lsp-mode/commit/ec441a1761c9a071b8648f2fd2673043df968d4c added a reverse of the
documentChange
requests, which we don't quite understand.Steps to reproduce
A (probably too big) reproducer is as follows:
Expected behavior
Given the above input, the expected output is
but since we apply the change on line one first, the output that we actually get is
Which Language Server did you use?
haskell-language-server
OS
Linux
Error callstack
No response
Anything else?
The
seq-reverse
is explicitly mentioned in the commit message, so it seems very intentional. The question now is why that commit was added; is there something in the specification that we missed that specifies the order of different entries indocumentChange
?I believe @akshaymankar tried this with neovim's coc (or VSCodium?) and couldn't reproduce it there, so this doesn't seem like standard behaviour across lsp implementations