diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-07-14 17:40:16 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-07-14 17:40:16 -0700 |
commit | 98085ebc2eb39569db89a34c8d820a5d0bfe8f84 (patch) | |
tree | 1c33c01134785ae6fd8a82fd8fd43702e1c686aa | |
parent | 6baa3fe2f83971b92f6617c3caa2c6c0351a8e8c (diff) | |
download | sncontinue-98085ebc2eb39569db89a34c8d820a5d0bfe8f84.tar.gz sncontinue-98085ebc2eb39569db89a34c8d820a5d0bfe8f84.tar.bz2 sncontinue-98085ebc2eb39569db89a34c8d820a5d0bfe8f84.zip |
fixed config explanation, don't read terminals
-rw-r--r-- | continuedev/src/continuedev/steps/open_config.py | 4 | ||||
-rw-r--r-- | extension/src/continueIdeClient.ts | 26 |
2 files changed, 17 insertions, 13 deletions
diff --git a/continuedev/src/continuedev/steps/open_config.py b/continuedev/src/continuedev/steps/open_config.py index 87f03e9f..af55a95a 100644 --- a/continuedev/src/continuedev/steps/open_config.py +++ b/continuedev/src/continuedev/steps/open_config.py @@ -14,10 +14,10 @@ class OpenConfigStep(Step): "custom_commands": [ { "name": "test", - "description": "Write unit tests like I do for the highlighted code" + "description": "Write unit tests like I do for the highlighted code", "prompt": "Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated." } - ], + ] ``` `"name"` is the command you will type. `"description"` is the description displayed in the slash command menu. diff --git a/extension/src/continueIdeClient.ts b/extension/src/continueIdeClient.ts index 6dd117d3..2c96763d 100644 --- a/extension/src/continueIdeClient.ts +++ b/extension/src/continueIdeClient.ts @@ -15,6 +15,7 @@ import { FileEditWithFullContents } from "../schema/FileEditWithFullContents"; import fs = require("fs"); import { WebsocketMessenger } from "./util/messenger"; import { diffManager } from "./diffs"; +import path = require("path"); class IdeProtocolClient { private messenger: WebsocketMessenger | null = null; @@ -350,25 +351,28 @@ class IdeProtocolClient { // ------------------------------------ // // Respond to request + private editorIsTerminal(editor: vscode.TextEditor) { + return ( + !!path.basename(editor.document.uri.fsPath).match(/\d/) || + (editor.document.languageId === "plaintext" && + editor.document.getText() === "accessible-buffer-accessible-buffer-") + ); + } + getOpenFiles(): string[] { return vscode.window.visibleTextEditors - .filter((editor) => { - return !( - editor.document.uri.fsPath.endsWith("/1") || - (editor.document.languageId === "plaintext" && - editor.document.getText() === - "accessible-buffer-accessible-buffer-") - ); - }) + .filter((editor) => !this.editorIsTerminal(editor)) .map((editor) => { return editor.document.uri.fsPath; }); } getVisibleFiles(): string[] { - return vscode.window.visibleTextEditors.map((editor) => { - return editor.document.uri.fsPath; - }); + return vscode.window.visibleTextEditors + .filter((editor) => !this.editorIsTerminal(editor)) + .map((editor) => { + return editor.document.uri.fsPath; + }); } saveFile(filepath: string) { |