Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 27270db

Browse filesBrowse files
authored
Ensure python selector supports returning created env (#25088)
1 parent 98aaab1 commit 27270db
Copy full SHA for 27270db

File tree

Expand file treeCollapse file tree

1 file changed

+6
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-4
lines changed

‎src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts

Copy file name to clipboardExpand all lines: src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ import { BaseInterpreterSelectorCommand } from './base';
4949
import { untildify } from '../../../../common/helpers';
5050
import { useEnvExtension } from '../../../../envExt/api.internal';
5151
import { setInterpreterLegacy } from '../../../../envExt/api.legacy';
52+
import { CreateEnvironmentResult } from '../../../../pythonEnvironments/creation/proposed.createEnvApis';
5253

5354
export type InterpreterStateArgs = { path?: string; workspace: Resource };
5455
export type QuickPickType = IInterpreterQuickPickItem | ISpecialQuickPickItem | QuickPickItem;
@@ -229,12 +230,13 @@ export class SetInterpreterCommand extends BaseInterpreterSelectorCommand implem
229230
sendTelemetryEvent(EventName.SELECT_INTERPRETER_ENTER_OR_FIND);
230231
return this._enterOrBrowseInterpreterPath.bind(this);
231232
} else if (selection.label === this.createEnvironmentSuggestion.label) {
232-
this.commandManager
233-
.executeCommand(Commands.Create_Environment, {
233+
const createdEnv = (await Promise.resolve(
234+
this.commandManager.executeCommand(Commands.Create_Environment, {
234235
showBackButton: false,
235236
selectEnvironment: true,
236-
})
237-
.then(noop, noop);
237+
}),
238+
).catch(noop)) as CreateEnvironmentResult | undefined;
239+
state.path = createdEnv?.path;
238240
} else if (selection.label === this.noPythonInstalled.label) {
239241
this.commandManager.executeCommand(Commands.InstallPython).then(noop, noop);
240242
this.wasNoPythonInstalledItemClicked = true;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.