Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 518631 - [lsp] Orion does not consider TextDocumentSyncOptions fr…
…om the server

Fix the document synchronization code when sending the complete
document. The original code was actally sending the content prior to
the changes instead of including them.

Signed-off-by: Remy Suen <remy.suen@gmail.com>
  • Loading branch information
rcjsuen committed Jun 23, 2017
1 parent 83ed03c commit 86944a9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bundles/org.eclipse.orion.client.ui/web/orion/editorView.js
Expand Up @@ -389,8 +389,12 @@ define([
if (textDocumentSync) {
if (textDocumentSync === 1 || textDocumentSync.change === 1) {
// TextDocumentSyncKind.Full, send the entire document
// get the text before it was modified
var text = textView.getText();
// get the substrings then insert the text in between
text = text.substring(0, evnt.start) + evnt.text + text.substring(evnt.start + evnt.removedCharCount);
var change = {
text: textView.getText()
text: text
};
var metaData = inputManager.getFileMetadata();
languageServer.didChange(metaData.Location, openedDocument.version++, [change]);
Expand Down

0 comments on commit 86944a9

Please sign in to comment.