-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Problem with Range in TextDocumentContentChangeEvent #29
Labels
bug
Something isn't working
Comments
@slzatz sorry for the delay. will looking it. |
Branch issue-29-Problem_with_Range_in_TextDocumentContentChangeEvent created! |
I stumbled upon this too. Are pull requests welcome for this issue? Is it important to maintain API backward compatibility here? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When generating a textDocument/didChange notification from a client you run into the following problem if you want to indicate that the content you are sending to the server is the entire document.
As you note in the comments: "If range and rangeLength are omitted the new text is considered to be the full content of the document."
However, you can't omit range in straightforward way unless you make it a pointer and add "omitempty"
So the TextDocumentContentChangeEvent type's Range field (in text.go) would become:
With that change providing no Range produces the correct json (no Range information at all) whereas without the change you get a Range type struct with start and end type structs containing line and character fields set to zero and that is not interpreted by gopls (I haven't checked other lsps) as having omitted the range.
The text was updated successfully, but these errors were encountered: