You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Range *Range `json:"range,omitempty"`
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:
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: