From af350f5e70f20d14c361684e361b1e64e5e0b2c3 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Mon, 12 Jun 2023 12:21:26 -0700 Subject: cleaner highlighting (from server side) --- extension/src/continueIdeClient.ts | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) (limited to 'extension') diff --git a/extension/src/continueIdeClient.ts b/extension/src/continueIdeClient.ts index c395ae0e..035778a5 100644 --- a/extension/src/continueIdeClient.ts +++ b/extension/src/continueIdeClient.ts @@ -278,40 +278,13 @@ class IdeProtocolClient { undefined, vscode.ViewColumn.One ).then((editor) => { - let range = new vscode.Range( + const range = new vscode.Range( edit.range.start.line, edit.range.start.character, edit.range.end.line, edit.range.end.character ); - const decorationKey = - edit.replacement === "" - ? { - editorUri: editor.document.uri.fsPath, - options: { - range: new vscode.Range( - new vscode.Position(range.start.line, 0), - new vscode.Position(range.end.line + 1, 0) - ), - // after: { - // contentText: "Removed", - // }, - }, - decorationType: vscode.window.createTextEditorDecorationType({ - backgroundColor: "rgba(255, 0, 0, 0.2)", - }), - } - : { - editorUri: editor.document.uri.fsPath, - options: { - range, - }, - decorationType: vscode.window.createTextEditorDecorationType({ - backgroundColor: "rgba(66, 105, 55, 1.0)", - isWholeLine: true, - }), - }; - decorationManager.addDecoration(decorationKey); + editor.edit((editBuilder) => { this._makingEdit += 2; // editBuilder.replace takes 2 edits: delete and insert editBuilder.replace(range, edit.replacement); -- cgit v1.2.3-70-g09d2