summaryrefslogtreecommitdiff
path: root/extension/src
diff options
context:
space:
mode:
Diffstat (limited to 'extension/src')
-rw-r--r--extension/src/activation/environmentSetup.ts33
-rw-r--r--extension/src/continueIdeClient.ts2
-rw-r--r--extension/src/debugPanel.ts14
-rw-r--r--extension/src/util/messenger.ts1
4 files changed, 20 insertions, 30 deletions
diff --git a/extension/src/activation/environmentSetup.ts b/extension/src/activation/environmentSetup.ts
index 10a9f75f..db215e11 100644
--- a/extension/src/activation/environmentSetup.ts
+++ b/extension/src/activation/environmentSetup.ts
@@ -82,18 +82,18 @@ export function getExtensionVersion() {
// Returns whether a server of the current version is already running
async function checkOrKillRunningServer(serverUrl: string): Promise<boolean> {
- console.log("Checking if server is old version");
const serverRunning = await checkServerRunning(serverUrl);
// Kill the server if it is running an old version
if (fs.existsSync(serverVersionPath())) {
const serverVersion = fs.readFileSync(serverVersionPath(), "utf8");
if (serverVersion === getExtensionVersion() && serverRunning) {
// The current version is already up and running, no need to continue
+ console.log("Continue server already running");
return true;
}
}
if (serverRunning) {
- console.log("Killing old server...");
+ console.log("Killing server from old version of Continue");
try {
await fkill(":65432");
} catch (e: any) {
@@ -196,16 +196,10 @@ export async function startContinuePythonServer() {
// Get name of the corresponding executable for platform
if (os.platform() === "darwin") {
// Add necessary permissions
- console.log("Setting permissions for Continue server...");
fs.chmodSync(destination, 0o7_5_5);
- const [stdout1, stderr1] = await runCommand(
- `xattr -dr com.apple.quarantine ${destination}`
- );
- console.log("stdout: ", stdout1);
- console.log("stderr: ", stderr1);
+ await runCommand(`xattr -dr com.apple.quarantine ${destination}`);
} else if (os.platform() === "linux") {
// Add necessary permissions
- console.log("Setting permissions for Continue server...");
fs.chmodSync(destination, 0o7_5_5);
}
@@ -217,25 +211,12 @@ export async function startContinuePythonServer() {
}
// Run the executable
- console.log("Starting Continue server...");
+ console.log("Starting Continue server");
const child = spawn(destination, {
- shell: true,
- });
- child.stderr.on("data", (data: any) => {
- console.log(data.toString());
- });
-
- child.on("error", (error: any) => {
- console.log(`error: ${error.message}`);
- });
-
- child.on("close", (code: any) => {
- console.log(`child process exited with code ${code}`);
- });
-
- child.stdout.on("data", (data: any) => {
- console.log(`stdout: ${data.toString()}`);
+ detached: true,
+ stdio: "ignore",
});
+ child.unref();
// Write the current version of vscode extension to a file called server_version.txt
fs.writeFileSync(serverVersionPath(), getExtensionVersion());
diff --git a/extension/src/continueIdeClient.ts b/extension/src/continueIdeClient.ts
index 1fa41383..cb7baaa6 100644
--- a/extension/src/continueIdeClient.ts
+++ b/extension/src/continueIdeClient.ts
@@ -413,7 +413,7 @@ class IdeProtocolClient {
clearInterval(interval);
resolve(null);
} else {
- console.log("Websocket not yet open, trying again...");
+ // console.log("Websocket not yet open, trying again...");
}
}, 1000);
});
diff --git a/extension/src/debugPanel.ts b/extension/src/debugPanel.ts
index 66d22e24..d1fe565f 100644
--- a/extension/src/debugPanel.ts
+++ b/extension/src/debugPanel.ts
@@ -181,13 +181,11 @@ export function setupDebugPanel(
switch (data.type) {
case "onLoad": {
let sessionId: string;
- console.log("Waiting for session id");
if (typeof sessionIdPromise === "string") {
sessionId = sessionIdPromise;
} else {
sessionId = await sessionIdPromise;
}
- console.log("Done with onLoad: ", sessionId);
panel.webview.postMessage({
type: "onLoad",
vscMachineId: vscode.env.machineId,
@@ -240,10 +238,22 @@ export function setupDebugPanel(
openEditorAndRevealRange(data.path, undefined, vscode.ViewColumn.One);
break;
}
+ case "toggleDevTools": {
+ vscode.commands.executeCommand("workbench.action.toggleDevTools");
+ vscode.commands.executeCommand("continue.viewLogs");
+ break;
+ }
case "blurContinueInput": {
setFocusedOnContinueInput(false);
break;
}
+ case "focusEditor": {
+ setFocusedOnContinueInput(false);
+ vscode.commands.executeCommand(
+ "workbench.action.focusActiveEditorGroup"
+ );
+ break;
+ }
case "withProgress": {
// This message allows withProgress to be used in the webview
if (data.done) {
diff --git a/extension/src/util/messenger.ts b/extension/src/util/messenger.ts
index 3044898e..bcc88fe1 100644
--- a/extension/src/util/messenger.ts
+++ b/extension/src/util/messenger.ts
@@ -1,4 +1,3 @@
-console.log("Websocket import");
const WebSocket = require("ws");
import fetch from "node-fetch";