From d26e995342b8df02135a5cbf0d385a2c02a6dd5b Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 13 Aug 2020 20:49:00 -0700 Subject: [PATCH] Revert "Make updateBuffer use incremental updates" --- src/features/changeForwarding.ts | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/features/changeForwarding.ts b/src/features/changeForwarding.ts index f407183af..771f491a0 100644 --- a/src/features/changeForwarding.ts +++ b/src/features/changeForwarding.ts @@ -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'; @@ -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; });