summaryrefslogtreecommitdiff
path: root/extension/src
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-07-18 14:02:03 -0700
committerNate Sesti <sestinj@gmail.com>2023-07-18 14:02:03 -0700
commit54c975f1454b353590435c262d558a71e6013865 (patch)
treec6b0cdcf8b0c16c09800240c7355f9a2ac9f6eb3 /extension/src
parent7d56cc5ed9b07da49d746fc02e612602d80d35d9 (diff)
downloadsncontinue-54c975f1454b353590435c262d558a71e6013865.tar.gz
sncontinue-54c975f1454b353590435c262d558a71e6013865.tar.bz2
sncontinue-54c975f1454b353590435c262d558a71e6013865.zip
error handle on invalid config file, don't immediately show loading message
Diffstat (limited to 'extension/src')
-rw-r--r--extension/src/activation/activate.ts48
-rw-r--r--extension/src/activation/environmentSetup.ts2
-rw-r--r--extension/src/extension.ts12
3 files changed, 37 insertions, 25 deletions
diff --git a/extension/src/activation/activate.ts b/extension/src/activation/activate.ts
index 5c6ffa02..8ea08e89 100644
--- a/extension/src/activation/activate.ts
+++ b/extension/src/activation/activate.ts
@@ -36,22 +36,44 @@ export async function activateExtension(context: vscode.ExtensionContext) {
})
.catch((e) => console.log("Error checking for extension updates: ", e));
- // Start the Python server
- await new Promise((resolve, reject) => {
- vscode.window.withProgress(
- {
- location: vscode.ProgressLocation.Notification,
- title:
- "Starting Continue Server... (it may take a minute to download Python packages)",
- cancellable: false,
- },
- async (progress, token) => {
- await startContinuePythonServer();
- resolve(null);
+ // Wrap the server start logic in a new Promise
+ const serverStartPromise = new Promise((resolve, reject) => {
+ let serverStarted = false;
+
+ // Start the server and set serverStarted to true when done
+ startContinuePythonServer().then(() => {
+ serverStarted = true;
+ resolve(null);
+ });
+
+ // Wait for 2 seconds
+ setTimeout(() => {
+ // If the server hasn't started after 2 seconds, show the notification
+ if (!serverStarted) {
+ vscode.window.withProgress(
+ {
+ location: vscode.ProgressLocation.Notification,
+ title:
+ "Starting Continue Server... (it may take a minute to download Python packages)",
+ cancellable: false,
+ },
+ async (progress, token) => {
+ // Wait for the server to start
+ while (!serverStarted) {
+ await new Promise((innerResolve) =>
+ setTimeout(innerResolve, 1000)
+ );
+ }
+ return Promise.resolve();
+ }
+ );
}
- );
+ }, 2000);
});
+ // Await the server start promise
+ await serverStartPromise;
+
// Register commands and providers
sendTelemetryEvent(TelemetryEvent.ExtensionActivated);
registerAllCodeLensProviders(context);
diff --git a/extension/src/activation/environmentSetup.ts b/extension/src/activation/environmentSetup.ts
index 69a3b75a..c341db39 100644
--- a/extension/src/activation/environmentSetup.ts
+++ b/extension/src/activation/environmentSetup.ts
@@ -39,7 +39,7 @@ async function retryThenFail(
// Show corresponding error message depending on the platform
let msg =
- "Failed to set up Continue extension. Please email nate@continue.dev and we'll get this fixed ASAP!";
+ "Failed to set up Continue extension. Please email hi@continue.dev and we'll get this fixed ASAP!";
try {
switch (process.platform) {
case "win32":
diff --git a/extension/src/extension.ts b/extension/src/extension.ts
index 6959ec05..f2e580a1 100644
--- a/extension/src/extension.ts
+++ b/extension/src/extension.ts
@@ -17,15 +17,5 @@ async function dynamicImportAndActivate(context: vscode.ExtensionContext) {
}
export function activate(context: vscode.ExtensionContext) {
- // Only show progress if we have to setup
- vscode.window.withProgress(
- {
- location: vscode.ProgressLocation.Notification,
- title: "Setting up Continue extension...",
- cancellable: false,
- },
- async () => {
- dynamicImportAndActivate(context);
- }
- );
+ dynamicImportAndActivate(context);
}