Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 518664 - [lsp] DidChangeTextDocumentParams are sent back with inc…
…omplete parameters

When a document has been modified, the client must send a
notification back to the server to notify it of the change. If the
server supports incremental document synchronization, the range of
the document that has been modified must be included in the
notification. While TextDocumentContentChangeEvent also takes a
rangeLength parameter, due to the ambiguity of the protocol, we
should make sure both the range and the rangeLength is set properly
so that servers can use either piece of information to analyze the
changed document.

Signed-off-by: Remy Suen <remy.suen@gmail.com>
  • Loading branch information
rcjsuen committed Jul 8, 2017
1 parent 1d9d3ee commit 962d727
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -401,7 +401,7 @@ define([
} else if (textDocumentSync === languageServer.ipc.TEXT_DOCUMENT_SYNC_KIND.Incremental) {
// TextDocumentSyncKind.Incremental, only send what changed
var change = {
range: Utils.getRange(editor, evnt.start, evnt.start),
range: Utils.getRange(editor, evnt.start, evnt.start + evnt.removedCharCount),
rangeLength: evnt.removedCharCount,
text: evnt.text
};
Expand Down

0 comments on commit 962d727

Please sign in to comment.