summaryrefslogtreecommitdiff
path: root/extension/src
diff options
context:
space:
mode:
authorNate Sesti <33237525+sestinj@users.noreply.github.com>2023-06-12 21:36:11 -0700
committerGitHub <noreply@github.com>2023-06-12 21:36:11 -0700
commit6676ff5ae1141dd37a11cfaa1dc07c8d24dcbf76 (patch)
treeb66cd84fc66d21daac2333b9f7c6b4ee54370ed9 /extension/src
parent19769044e875295c2e247dfd4c9d91ab1bf5dc28 (diff)
parent221d352e149a9b09e48010f14e98049bada2e7eb (diff)
downloadsncontinue-6676ff5ae1141dd37a11cfaa1dc07c8d24dcbf76.tar.gz
sncontinue-6676ff5ae1141dd37a11cfaa1dc07c8d24dcbf76.tar.bz2
sncontinue-6676ff5ae1141dd37a11cfaa1dc07c8d24dcbf76.zip
Merge pull request #76 from continuedev/superset-of-chat
Superset of chat
Diffstat (limited to 'extension/src')
-rw-r--r--extension/src/continueIdeClient.ts6
-rw-r--r--extension/src/decorations.ts19
2 files changed, 17 insertions, 8 deletions
diff --git a/extension/src/continueIdeClient.ts b/extension/src/continueIdeClient.ts
index 42671ade..92af6b10 100644
--- a/extension/src/continueIdeClient.ts
+++ b/extension/src/continueIdeClient.ts
@@ -13,6 +13,7 @@ import { FileEditWithFullContents } from "../schema/FileEditWithFullContents";
import fs = require("fs");
import { WebsocketMessenger } from "./util/messenger";
import { CapturedTerminal } from "./terminal/terminalEmulator";
+import { decorationManager } from "./decorations";
class IdeProtocolClient {
private messenger: WebsocketMessenger | null = null;
@@ -277,12 +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 + 1
+ edit.range.end.character
);
+
editor.edit((editBuilder) => {
this._makingEdit += 2; // editBuilder.replace takes 2 edits: delete and insert
editBuilder.replace(range, edit.replacement);
diff --git a/extension/src/decorations.ts b/extension/src/decorations.ts
index 456f0c10..d2c94135 100644
--- a/extension/src/decorations.ts
+++ b/extension/src/decorations.ts
@@ -94,15 +94,22 @@ class DecorationManager {
decorationTypes = new Map();
decorationTypes.set(key.decorationType, [key.options]);
this.editorToDecorations.set(key.editorUri, decorationTypes);
- }
-
- const decorations = decorationTypes.get(key.decorationType);
- if (!decorations) {
- decorationTypes.set(key.decorationType, [key.options]);
} else {
- decorations.push(key.options);
+ const decorations = decorationTypes.get(key.decorationType);
+ if (!decorations) {
+ decorationTypes.set(key.decorationType, [key.options]);
+ } else {
+ decorations.push(key.options);
+ }
}
+
this.rerenderDecorations(key.editorUri, key.decorationType);
+
+ vscode.window.onDidChangeTextEditorSelection((event) => {
+ if (event.textEditor.document.fileName === key.editorUri) {
+ this.deleteAllDecorations(key.editorUri);
+ }
+ });
}
deleteDecoration(key: DecorationKey) {