summaryrefslogtreecommitdiff
path: root/extension/src/extension.ts
diff options
context:
space:
mode:
Diffstat (limited to 'extension/src/extension.ts')
-rw-r--r--extension/src/extension.ts37
1 files changed, 37 insertions, 0 deletions
diff --git a/extension/src/extension.ts b/extension/src/extension.ts
new file mode 100644
index 00000000..e0b94278
--- /dev/null
+++ b/extension/src/extension.ts
@@ -0,0 +1,37 @@
+/**
+ * This is the entry point for the extension.
+ */
+
+import * as vscode from "vscode";
+import {
+ setupExtensionEnvironment,
+ isPythonEnvSetup,
+ startContinuePythonServer,
+} from "./activation/environmentSetup";
+
+async function dynamicImportAndActivate(
+ context: vscode.ExtensionContext,
+ showTutorial: boolean
+) {
+ const { activateExtension } = await import("./activation/activate");
+ activateExtension(context, showTutorial);
+}
+
+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 () => {
+ if (isPythonEnvSetup()) {
+ await startContinuePythonServer();
+ } else {
+ await setupExtensionEnvironment();
+ }
+ dynamicImportAndActivate(context, true);
+ }
+ );
+}