Skip to content

Clarification needed for TextDocumentContentChangeEvent #53

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

Closed
natgabb opened this issue Aug 19, 2016 · 3 comments
Closed

Clarification needed for TextDocumentContentChangeEvent #53

natgabb opened this issue Aug 19, 2016 · 3 comments

Comments

@natgabb
Copy link
Contributor

natgabb commented Aug 19, 2016

https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#didchangetextdocument-notification

The definition of TextDocumentContentChangeEvent is a bit unclear. Is the range inclusive at the start and end? Only at the start? What is rangeLength used for?

@gorkem
Copy link
Contributor

gorkem commented Aug 31, 2016

similar to #9 ?

@natgabb
Copy link
Contributor Author

natgabb commented Sep 1, 2016

That answers why rangeLength is in the request, but not whether the Range is inclusive or exclusive on the endCharacter.
In the groovy-language-server we ended up implementing didChange by assuming endCharacter is exclusive because it allows for insertion, example: Range= (0,0) to (0,0[ while also allowing for single character replacement example: Range= (0,1) to (0,2[.

@dbaeumer
Copy link
Member

It is exclusive. Conceptually a range are two position where a positions is between two characters (like a cursor). I clarified that in the documentation.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants