Skip to content

Commit

Permalink
Revert "Make updateBuffer use incremental updates"
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeRobich authored Aug 14, 2020
1 parent fb71e7a commit d26e995
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/features/changeForwarding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { Uri, workspace } from 'vscode';
import { OmniSharpServer } from '../omnisharp/server';
import * as serverUtils from '../omnisharp/utils';
import { FileChangeType, LinePositionSpanTextChange } from '../omnisharp/protocol';
import { FileChangeType } from '../omnisharp/protocol';
import { IDisposable } from '../Disposable';
import CompositeDisposable from '../CompositeDisposable';

Expand All @@ -23,18 +23,7 @@ function forwardDocumentChanges(server: OmniSharpServer): IDisposable {
return;
}

const lineChanges = event.contentChanges.map(function (change): LinePositionSpanTextChange {
const range = change.range;
return {
NewText: change.text,
StartLine: range.start.line + 1,
StartColumn: range.start.character + 1,
EndLine: range.end.line + 1,
EndColumn: range.end.character + 1
};
});

serverUtils.updateBuffer(server, { Changes: lineChanges, FileName: document.fileName }).catch(err => {
serverUtils.updateBuffer(server, { Buffer: document.getText(), FileName: document.fileName }).catch(err => {
console.error(err);
return err;
});
Expand Down

0 comments on commit d26e995

Please sign in to comment.