diff options
Diffstat (limited to 'extension')
-rw-r--r-- | extension/package-lock.json | 4 | ||||
-rw-r--r-- | extension/package.json | 7 | ||||
-rw-r--r-- | extension/src/activation/activate.ts | 4 | ||||
-rw-r--r-- | extension/src/activation/environmentSetup.ts | 11 | ||||
-rw-r--r-- | extension/src/commands.ts | 13 | ||||
-rw-r--r-- | extension/src/continueIdeClient.ts | 13 | ||||
-rw-r--r-- | extension/src/extension.ts | 17 |
7 files changed, 54 insertions, 15 deletions
diff --git a/extension/package-lock.json b/extension/package-lock.json index f232333e..d70370b7 100644 --- a/extension/package-lock.json +++ b/extension/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.0.209", + "version": "0.0.210", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "continue", - "version": "0.0.209", + "version": "0.0.210", "license": "Apache-2.0", "dependencies": { "@electron/rebuild": "^3.2.10", diff --git a/extension/package.json b/extension/package.json index 31eb3cac..e53b686d 100644 --- a/extension/package.json +++ b/extension/package.json @@ -14,7 +14,7 @@ "displayName": "Continue", "pricing": "Free", "description": "The open-source coding autopilot", - "version": "0.0.209", + "version": "0.0.210", "publisher": "Continue", "engines": { "vscode": "^1.67.0" @@ -106,6 +106,11 @@ "command": "continue.quickFix", "category": "Continue", "title": "Quick Fix" + }, + { + "command": "continue.viewLogs", + "category": "Continue", + "title": "View Logs" } ], "keybindings": [ diff --git a/extension/src/activation/activate.ts b/extension/src/activation/activate.ts index 430f9f4a..40f1bbd5 100644 --- a/extension/src/activation/activate.ts +++ b/extension/src/activation/activate.ts @@ -22,6 +22,10 @@ function getExtensionVersionInt(versionString: string): number { export async function activateExtension(context: vscode.ExtensionContext) { extensionContext = context; console.log("Using Continue version: ", getExtensionVersion()); + console.log( + "In workspace: ", + vscode.workspace.workspaceFolders?.[0].uri.fsPath + ); // Before anything else, check whether this is an out-of-date version of the extension // Do so by grabbing the package.json off of the GitHub respository for now. fetch(PACKAGE_JSON_RAW_GITHUB_URL) diff --git a/extension/src/activation/environmentSetup.ts b/extension/src/activation/environmentSetup.ts index 5a9345a6..c8998bee 100644 --- a/extension/src/activation/environmentSetup.ts +++ b/extension/src/activation/environmentSetup.ts @@ -53,7 +53,16 @@ async function retryThenFail( } } finally { console.log("After retries, failed to set up Continue extension", msg); - vscode.window.showErrorMessage(msg); + vscode.window + .showErrorMessage(msg, "View Logs", "Retry") + .then((selection) => { + if (selection === "View Logs") { + vscode.commands.executeCommand("continue.viewLogs"); + } else if (selection === "Retry") { + // Reload VS Code window + vscode.commands.executeCommand("workbench.action.reloadWindow"); + } + }); } throw e; diff --git a/extension/src/commands.ts b/extension/src/commands.ts index 1da2f04e..35d466e8 100644 --- a/extension/src/commands.ts +++ b/extension/src/commands.ts @@ -1,9 +1,6 @@ import * as vscode from "vscode"; -import { - decorationManager, - showAnswerInTextEditor, - showGutterSpinner, -} from "./decorations"; +import * as path from "path"; +import * as os from "os"; import { acceptSuggestionCommand, rejectSuggestionCommand, @@ -65,6 +62,12 @@ const commandsMap: { [command: string]: (...args: any) => any } = { ideProtocolClient.sendMainUserInput(text); } }, + "continue.viewLogs": async () => { + // Open ~/.continue/continue.log + const logFile = path.join(os.homedir(), ".continue", "continue.log"); + const uri = vscode.Uri.file(logFile); + await vscode.window.showTextDocument(uri); + }, }; export function registerAllCommands(context: vscode.ExtensionContext) { diff --git a/extension/src/continueIdeClient.ts b/extension/src/continueIdeClient.ts index 4e6f0494..157b59cb 100644 --- a/extension/src/continueIdeClient.ts +++ b/extension/src/continueIdeClient.ts @@ -72,9 +72,16 @@ class IdeProtocolClient { }); messenger.onMessage((messageType, data, messenger) => { this.handleMessage(messageType, data, messenger).catch((err) => { - vscode.window.showErrorMessage( - "Error handling message from Continue server: " + err.message - ); + vscode.window + .showErrorMessage( + "Error handling message from Continue server: " + err.message, + "View Logs" + ) + .then((selection) => { + if (selection === "View Logs") { + vscode.commands.executeCommand("continue.viewLogs"); + } + }); }); }); } diff --git a/extension/src/extension.ts b/extension/src/extension.ts index f2e580a1..802b12bc 100644 --- a/extension/src/extension.ts +++ b/extension/src/extension.ts @@ -10,9 +10,20 @@ async function dynamicImportAndActivate(context: vscode.ExtensionContext) { await activateExtension(context); } catch (e) { console.log("Error activating extension: ", e); - vscode.window.showInformationMessage( - "Error activating the Continue extension." - ); + vscode.window + .showInformationMessage( + "Error activating the Continue extension.", + "View Logs", + "Retry" + ) + .then((selection) => { + if (selection === "View Logs") { + vscode.commands.executeCommand("continue.viewLogs"); + } else if (selection === "Retry") { + // Reload VS Code window + vscode.commands.executeCommand("workbench.action.reloadWindow"); + } + }); } } |