summaryrefslogtreecommitdiff
path: root/extension/src
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-07-11 16:40:11 -0700
committerNate Sesti <sestinj@gmail.com>2023-07-11 16:40:11 -0700
commit72ade108029a1f3a1f5964501ff4670e655efa6b (patch)
tree45075d2108c1db3c959a548d9e9f7283a00a6ddf /extension/src
parenta6c2490bc32dd670f4afaf6db097422e920404e8 (diff)
downloadsncontinue-72ade108029a1f3a1f5964501ff4670e655efa6b.tar.gz
sncontinue-72ade108029a1f3a1f5964501ff4670e655efa6b.tar.bz2
sncontinue-72ade108029a1f3a1f5964501ff4670e655efa6b.zip
explain accept/reject, better edit summaries
Diffstat (limited to 'extension/src')
-rw-r--r--extension/src/diffs.ts29
1 files changed, 27 insertions, 2 deletions
diff --git a/extension/src/diffs.ts b/extension/src/diffs.ts
index 3ea6b4f8..28089fc6 100644
--- a/extension/src/diffs.ts
+++ b/extension/src/diffs.ts
@@ -2,7 +2,7 @@ import * as os from "os";
import * as path from "path";
import * as fs from "fs";
import * as vscode from "vscode";
-import { ideProtocolClient } from "./activation/activate";
+import { extensionContext, ideProtocolClient } from "./activation/activate";
interface DiffInfo {
originalFilepath: string;
@@ -70,6 +70,28 @@ class DiffManager {
.getConfiguration("diffEditor", editor.document.uri)
.update("codeLens", true, vscode.ConfigurationTarget.Global);
+ if (
+ extensionContext?.globalState.get<boolean>(
+ "continue.showDiffInfoMessage"
+ ) !== false
+ ) {
+ vscode.window
+ .showInformationMessage(
+ "Accept (⌘⇧↩) or reject (⌘⇧⌫) at the top of the file.",
+ "Got it",
+ "Don't show again"
+ )
+ .then((selection) => {
+ if (selection === "Don't show again") {
+ // Get the global state
+ extensionContext?.globalState.update(
+ "continue.showDiffInfoMessage",
+ false
+ );
+ }
+ });
+ }
+
return editor;
}
@@ -152,7 +174,10 @@ class DiffManager {
newFilepath = Array.from(this.diffs.keys())[0];
}
if (!newFilepath) {
- console.log("No newFilepath provided to reject the diff");
+ console.log(
+ "No newFilepath provided to reject the diff, diffs.size was",
+ this.diffs.size
+ );
return;
}
const diffInfo = this.diffs.get(newFilepath);