diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-07-24 01:00:42 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-07-24 01:00:42 -0700 |
commit | 2e376b7e61f68a48ccb2a5be7ab6ab55ab30c670 (patch) | |
tree | 6c1077859938fadce3a6f17f267127a66fd11df4 /extension/src/lang-server/codeLens.ts | |
parent | 59c549a468abd40207f8dc46eacdc0e02bbe21ad (diff) | |
parent | 82b03aeb0882cb884c398104b7934d63c6ceed00 (diff) | |
download | sncontinue-2e376b7e61f68a48ccb2a5be7ab6ab55ab30c670.tar.gz sncontinue-2e376b7e61f68a48ccb2a5be7ab6ab55ab30c670.tar.bz2 sncontinue-2e376b7e61f68a48ccb2a5be7ab6ab55ab30c670.zip |
Merge branch 'main' into show-react-immediately
Diffstat (limited to 'extension/src/lang-server/codeLens.ts')
-rw-r--r-- | extension/src/lang-server/codeLens.ts | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/extension/src/lang-server/codeLens.ts b/extension/src/lang-server/codeLens.ts index 778b98dc..ba80e557 100644 --- a/extension/src/lang-server/codeLens.ts +++ b/extension/src/lang-server/codeLens.ts @@ -2,7 +2,8 @@ import * as vscode from "vscode"; import { editorToSuggestions, editorSuggestionsLocked } from "../suggestions"; import * as path from "path"; import * as os from "os"; -import { DIFF_DIRECTORY } from "../diffs"; +import { DIFF_DIRECTORY, diffManager } from "../diffs"; +import { getMetaKeyLabel } from "../util/util"; class SuggestionsCodeLensProvider implements vscode.CodeLensProvider { public provideCodeLenses( document: vscode.TextDocument, @@ -35,7 +36,7 @@ class SuggestionsCodeLensProvider implements vscode.CodeLensProvider { if (codeLenses.length === 2) { codeLenses.push( new vscode.CodeLens(range, { - title: "(⌘⇧↩/⌘⇧⌫ to accept/reject all)", + title: `(${getMetaKeyLabel()}⇧↩/${getMetaKeyLabel()}⇧⌫ to accept/reject all)`, command: "", }) ); @@ -53,15 +54,19 @@ class DiffViewerCodeLensProvider implements vscode.CodeLensProvider { ): vscode.CodeLens[] | Thenable<vscode.CodeLens[]> { if (path.dirname(document.uri.fsPath) === DIFF_DIRECTORY) { const codeLenses: vscode.CodeLens[] = []; - const range = new vscode.Range(0, 0, 1, 0); + let range = new vscode.Range(0, 0, 1, 0); + const diffInfo = diffManager.diffAtNewFilepath(document.uri.fsPath); + if (diffInfo) { + range = diffInfo.range; + } codeLenses.push( new vscode.CodeLens(range, { - title: "Accept ✅ (⌘⇧↩)", + title: `Accept All ✅ (${getMetaKeyLabel()}⇧↩)`, command: "continue.acceptDiff", arguments: [document.uri.fsPath], }), new vscode.CodeLens(range, { - title: "Reject ❌ (⌘⇧⌫)", + title: `Reject All ❌ (${getMetaKeyLabel()}⇧⌫)`, command: "continue.rejectDiff", arguments: [document.uri.fsPath], }) |