summaryrefslogtreecommitdiff
path: root/extension
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-09-06 19:40:09 -0700
committerNate Sesti <sestinj@gmail.com>2023-09-06 19:40:09 -0700
commit41b3233693c34cd81c872a1e7279721b5f640d60 (patch)
treee8b1ace5444948e052a45f9dd89e418ed3eeefbb /extension
parent5d63d250409492a8ea9e554873b5b4a9221311a1 (diff)
downloadsncontinue-41b3233693c34cd81c872a1e7279721b5f640d60.tar.gz
sncontinue-41b3233693c34cd81c872a1e7279721b5f640d60.tar.bz2
sncontinue-41b3233693c34cd81c872a1e7279721b5f640d60.zip
fix: :bug: fixes for a few context_providers
Diffstat (limited to 'extension')
-rw-r--r--extension/src/continueIdeClient.ts16
1 files changed, 13 insertions, 3 deletions
diff --git a/extension/src/continueIdeClient.ts b/extension/src/continueIdeClient.ts
index 48000b76..3b46d90a 100644
--- a/extension/src/continueIdeClient.ts
+++ b/extension/src/continueIdeClient.ts
@@ -294,7 +294,7 @@ class IdeProtocolClient {
break;
case "getTerminalContents":
messenger.send("getTerminalContents", {
- contents: await this.getTerminalContents(),
+ contents: await this.getTerminalContents(data.commands),
});
break;
case "listDirectoryContents":
@@ -631,9 +631,19 @@ class IdeProtocolClient {
return contents;
}
- async getTerminalContents(): Promise<string> {
+ async getTerminalContents(commands: number = -1): Promise<string> {
const tempCopyBuffer = await vscode.env.clipboard.readText();
- await vscode.commands.executeCommand("workbench.action.terminal.selectAll");
+ if (commands < 0) {
+ await vscode.commands.executeCommand(
+ "workbench.action.terminal.selectAll"
+ );
+ } else {
+ for (let i = 0; i < commands; i++) {
+ await vscode.commands.executeCommand(
+ "workbench.action.terminal.selectToPreviousCommand"
+ );
+ }
+ }
await vscode.commands.executeCommand(
"workbench.action.terminal.copySelection"
);