fixed config explanation, don't read terminals
This commit is contained in:
parent
6baa3fe2f8
commit
98085ebc2e
2 changed files with 17 additions and 13 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue