New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
textDocument/didChange does not number versions according to content changes #411
Comments
I see that the spec is not good formulated here, but the only thing the spec requires is that with every change notification there is a new version number and that the number is increasing. However the number can not be used to indicate the number of internal changes nor must it be the case that the number is consecutive. From the spec: /**
* The version number of this document (it will increase after each
* change, including undo/redo).
*/
version: number; I will add a sentence to the |
I may have misunderstood this part of the spec for
I take it that the referenced document state numbers (S10-S12) are not the same as document version numbers? |
No, they are not. They talk about the state of the document. I could have used S' and S'' which I might consider to do to make this more clear. |
I made that change. |
I'm working on a language server that uses incremental document syncs. According to the specification, the document's version number should be incremented once for each content change, including when there are multiple changes in a single
textDocument/didChange
notification. The vscode client conforms in most cases, but occasionally the version number goes out of sync. From my tests, it appears that the most common causes are large copy/pastes, multiple consecutive undo operations, and bulk operations like indenting blocks of code.Here's a simple reproducible example:
textDocument/didOpen
notification with the version set to 1.textDocument/didChange
notification with the following parameters:Based on the specification, shouldn't the new version number be 5 instead of 2?
The text was updated successfully, but these errors were encountered: