diff --git a/src/extension.ts b/src/extension.ts index 0032f79c..abbf1677 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,4 +1,4 @@ -import { commands, ExtensionContext, extensions, LogOutputChannel, Terminal, Uri, window } from 'vscode'; +import { commands, ExtensionContext, extensions, l10n, LogOutputChannel, ProgressLocation, Terminal, Uri, window } from 'vscode'; import { PythonEnvironment, PythonEnvironmentApi, PythonProjectCreator } from './api'; import { ENVS_EXTENSION_ID } from './common/constants'; import { ensureCorrectVersion } from './common/extVersion'; @@ -16,6 +16,7 @@ import { createLogOutputChannel, onDidChangeActiveTerminal, onDidChangeTerminalShellIntegration, + withProgress, } from './common/window.apis'; import { getConfiguration } from './common/workspace.apis'; import { createManagerReady } from './features/common/managerReady'; @@ -181,9 +182,15 @@ export async function activate(context: ExtensionContext): Promise outputChannel.show()), commands.registerCommand('python-envs.refreshAllManagers', async () => { - await window.withProgress({ location: { viewId: 'env-managers' } }, async () => { - await Promise.all(envManagers.managers.map((m) => m.refresh(undefined))); - }); + await withProgress( + { + location: ProgressLocation.Notification, + title: l10n.t('Refreshing environment managers...'), + }, + async () => { + await Promise.all(envManagers.managers.map((m) => m.refresh(undefined))); + }, + ); }), commands.registerCommand('python-envs.searchSettings', async () => { await openSearchSettings(); @@ -201,7 +208,15 @@ export async function activate(context: ExtensionContext): Promise { + return await createEnvironmentCommand(item, envManagers, projectManager); + }, + ); }), commands.registerCommand('python-envs.createAny', async (options) => { // Telemetry: record environment creation attempt with no specific manager @@ -209,10 +224,18 @@ export async function activate(context: ExtensionContext): Promise { + return await createAnyEnvironmentCommand( + envManagers, + projectManager, + options ?? { selectEnvironment: true }, + ); + }, ); }), commands.registerCommand('python-envs.remove', async (item) => {