summaryrefslogtreecommitdiff
path: root/extension/src
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-07-12 15:19:57 -0700
committerNate Sesti <sestinj@gmail.com>2023-07-12 15:19:57 -0700
commitc31d7169e651d9fd37cdcaf4d69859d55c5a5e49 (patch)
tree3e5a90a2e7a43a27b5ea7b02ff0131f2e17c0423 /extension/src
parentd27c95686efb52182ce8cb24f48d197ba42510ab (diff)
downloadsncontinue-c31d7169e651d9fd37cdcaf4d69859d55c5a5e49.tar.gz
sncontinue-c31d7169e651d9fd37cdcaf4d69859d55c5a5e49.tar.bz2
sncontinue-c31d7169e651d9fd37cdcaf4d69859d55c5a5e49.zip
purging more
Diffstat (limited to 'extension/src')
-rw-r--r--extension/src/commands.ts92
1 files changed, 1 insertions, 91 deletions
diff --git a/extension/src/commands.ts b/extension/src/commands.ts
index ffb67ab5..0b002549 100644
--- a/extension/src/commands.ts
+++ b/extension/src/commands.ts
@@ -21,35 +21,6 @@ import { ideProtocolClient } from "./activation/activate";
// Copy everything over from extension.ts
const commandsMap: { [command: string]: (...args: any) => any } = {
- "continue.askQuestion": (data: any, webviewView: vscode.WebviewView) => {
- if (!vscode.workspace.workspaceFolders) {
- return;
- }
-
- answerQuestion(
- data.question,
- vscode.workspace.workspaceFolders[0].uri.fsPath,
- webviewView.webview
- );
- },
- "continue.askQuestionFromInput": () => {
- vscode.window
- .showInputBox({ placeHolder: "Ask away!" })
- .then((question) => {
- if (!question || !vscode.workspace.workspaceFolders) {
- return;
- }
-
- sendTelemetryEvent(TelemetryEvent.UniversalPromptQuery, {
- query: question,
- });
-
- answerQuestion(
- question,
- vscode.workspace.workspaceFolders[0].uri.fsPath
- );
- });
- },
"continue.suggestionDown": suggestionDownCommand,
"continue.suggestionUp": suggestionUpCommand,
"continue.acceptSuggestion": acceptSuggestionCommand,
@@ -73,27 +44,6 @@ const commandsMap: { [command: string]: (...args: any) => any } = {
if (text) {
ideProtocolClient.sendMainUserInput(text);
}
- vscode.commands.executeCommand("continue.continueGUIView.focus");
- },
-};
-
-const textEditorCommandsMap: { [command: string]: (...args: any) => {} } = {
- "continue.writeDocstring": async (editor: vscode.TextEditor, _) => {
- sendTelemetryEvent(TelemetryEvent.GenerateDocstring);
- let gutterSpinnerKey = showGutterSpinner(
- editor,
- editor.selection.active.line
- );
-
- const { lineno, docstring } = await bridge.writeDocstringForFunction(
- editor.document.fileName,
- editor.selection.active
- );
- // Can't use the edit given above after an async call
- editor.edit((edit) => {
- edit.insert(new vscode.Position(lineno, 0), docstring);
- decorationManager.deleteDecoration(gutterSpinnerKey);
- });
},
};
@@ -103,44 +53,4 @@ export function registerAllCommands(context: vscode.ExtensionContext) {
vscode.commands.registerCommand(command, callback)
);
}
-
- for (const [command, callback] of Object.entries(textEditorCommandsMap)) {
- context.subscriptions.push(
- vscode.commands.registerTextEditorCommand(command, callback)
- );
- }
-}
-
-async function answerQuestion(
- question: string,
- workspacePath: string,
- webview: vscode.Webview | undefined = undefined
-) {
- vscode.window.withProgress(
- {
- location: vscode.ProgressLocation.Notification,
- title: "Anwering question...",
- cancellable: false,
- },
- async (progress, token) => {
- try {
- let resp = await bridge.askQuestion(question, workspacePath);
- // Send the answer back to the webview
- if (webview) {
- webview.postMessage({
- type: "answerQuestion",
- answer: resp.answer,
- });
- }
- showAnswerInTextEditor(resp.filename, resp.range, resp.answer);
- } catch (error: any) {
- if (webview) {
- webview.postMessage({
- type: "answerQuestion",
- answer: error,
- });
- }
- }
- }
- );
-}
+} \ No newline at end of file