Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure we delay start pylance server #20910

Merged
merged 2 commits into from
Mar 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/client/browser/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ interface BrowserConfig {
let languageClient: LanguageClient | undefined;
let pylanceApi: PylanceApi | undefined;

export async function activate(context: vscode.ExtensionContext): Promise<IBrowserExtensionApi> {
export function activate(context: vscode.ExtensionContext): Promise<IBrowserExtensionApi> {
const reporter = getTelemetryReporter();

const activationPromise = Promise.resolve(buildApi(reporter));
const pylanceExtension = vscode.extensions.getExtension<PylanceApi>(PYLANCE_EXTENSION_ID);
if (pylanceExtension) {
await runPylance(context, pylanceExtension);
return buildApi(reporter);
// Make sure we run pylance once we activated core extension.
activationPromise.then(() => runPylance(context, pylanceExtension));
return activationPromise;
}

const changeDisposable = vscode.extensions.onDidChange(async () => {
Expand All @@ -37,7 +39,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<IBrows
}
});

return buildApi(reporter);
return activationPromise;
}

export async function deactivate(): Promise<void> {
Expand Down