Supress error which is logged on each save (vscode sending a duplicate edit?)

This commit is contained in:
Kris De Volder
2017-07-26 14:56:21 -07:00
parent a668b0664e
commit 5cef5f7e91

View File

@@ -21,6 +21,7 @@ import org.eclipse.lsp4j.TextDocumentContentChangeEvent;
import org.eclipse.lsp4j.TextDocumentIdentifier;
import org.springframework.ide.vscode.commons.util.Assert;
import org.springframework.ide.vscode.commons.util.BadLocationException;
import org.springframework.ide.vscode.commons.util.Log;
import org.springframework.ide.vscode.commons.util.text.linetracker.DefaultLineTracker;
import org.springframework.ide.vscode.commons.util.text.linetracker.ILineTracker;
@@ -88,11 +89,14 @@ public class TextDocument implements IDocument {
public synchronized void apply(DidChangeTextDocumentParams params) throws BadLocationException {
int newVersion = params.getTextDocument().getVersion();
Assert.isLegal(version<newVersion);
for (TextDocumentContentChangeEvent change : params.getContentChanges()) {
apply(change);
if (version<newVersion) {
for (TextDocumentContentChangeEvent change : params.getContentChanges()) {
apply(change);
}
this.version = newVersion;
} else {
Log.warn("Change event with bad version ignored: "+params);
}
this.version = newVersion;
}
/**