From 27ecedb02ef79ce53bf533e016b00462c44541be Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Tue, 23 May 2023 23:45:12 -0400 Subject: copying from old repo --- extension/src/extension.ts | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 extension/src/extension.ts (limited to 'extension/src/extension.ts') 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); + } + ); +} -- cgit v1.2.3-70-g09d2