|
1 | | -import { Uri, ThemeIcon, QuickPickItem, QuickPickItemKind, ProgressLocation, QuickInputButtons } from 'vscode'; |
2 | | -import { IconPath, PythonEnvironment, PythonProject } from '../../api'; |
| 1 | +import { ProgressLocation, QuickInputButtons, QuickPickItem, QuickPickItemKind, ThemeIcon, Uri } from 'vscode'; |
| 2 | +import { CreateEnvironmentOptions, IconPath, PythonEnvironment, PythonProject } from '../../api'; |
3 | 3 | import { InternalEnvironmentManager } from '../../internal.api'; |
4 | 4 | import { Common, Interpreter, Pickers } from '../localize'; |
5 | | -import { showQuickPickWithButtons, showQuickPick, showOpenDialog, withProgress } from '../window.apis'; |
6 | 5 | import { traceError } from '../logging'; |
7 | | -import { pickEnvironmentManager } from './managers'; |
8 | | -import { handlePythonPath } from '../utils/pythonPath'; |
9 | 6 | import { isWindows } from '../utils/platformUtils'; |
| 7 | +import { handlePythonPath } from '../utils/pythonPath'; |
| 8 | +import { showOpenDialog, showQuickPick, showQuickPickWithButtons, withProgress } from '../window.apis'; |
| 9 | +import { pickEnvironmentManager } from './managers'; |
10 | 10 |
|
11 | 11 | type QuickPickIcon = |
12 | 12 | | Uri |
@@ -77,12 +77,23 @@ async function createEnvironment( |
77 | 77 | projectEnvManagers.filter((m) => m.supportsCreate), |
78 | 78 | ); |
79 | 79 |
|
80 | | - const manager = managers.find((m) => m.id === managerId); |
| 80 | + let manager: InternalEnvironmentManager | undefined; |
| 81 | + let createOptions: CreateEnvironmentOptions | undefined = undefined; |
| 82 | + if (managerId?.includes(`QuickCreate#`)) { |
| 83 | + manager = managers.find((m) => m.id === managerId.split('#')[1]); |
| 84 | + createOptions = { |
| 85 | + projects: projectEnvManagers.map((m) => m), |
| 86 | + quickCreate: true, |
| 87 | + } as CreateEnvironmentOptions; |
| 88 | + } else { |
| 89 | + manager = managers.find((m) => m.id === managerId); |
| 90 | + } |
| 91 | + |
81 | 92 | if (manager) { |
82 | 93 | try { |
83 | 94 | const env = await manager.create( |
84 | 95 | options.projects.map((p) => p.uri), |
85 | | - undefined, |
| 96 | + createOptions, |
86 | 97 | ); |
87 | 98 | return env; |
88 | 99 | } catch (ex) { |
|
0 commit comments