|
1 | | -import { Uri, ThemeIcon, QuickPickItem, QuickPickItemKind, ProgressLocation, QuickInputButtons } from 'vscode'; |
| 1 | +import { ProgressLocation, QuickInputButtons, QuickPickItem, QuickPickItemKind, ThemeIcon, Uri } from 'vscode'; |
2 | 2 | import { 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'; |
| 6 | +import { EventNames } from '../telemetry/constants'; |
| 7 | +import { sendTelemetryEvent } from '../telemetry/sender'; |
9 | 8 | import { isWindows } from '../utils/platformUtils'; |
| 9 | +import { handlePythonPath } from '../utils/pythonPath'; |
| 10 | +import { showOpenDialog, showQuickPick, showQuickPickWithButtons, withProgress } from '../window.apis'; |
| 11 | +import { pickEnvironmentManager } from './managers'; |
10 | 12 |
|
11 | 13 | type QuickPickIcon = |
12 | 14 | | Uri |
@@ -80,6 +82,7 @@ async function createEnvironment( |
80 | 82 | const manager = managers.find((m) => m.id === managerId); |
81 | 83 | if (manager) { |
82 | 84 | try { |
| 85 | + // add telemetry here |
83 | 86 | const env = await manager.create( |
84 | 87 | options.projects.map((p) => p.uri), |
85 | 88 | undefined, |
@@ -111,6 +114,10 @@ async function pickEnvironmentImpl( |
111 | 114 | if (selected.label === Interpreter.browsePath) { |
112 | 115 | return browseForPython(managers, projectEnvManagers); |
113 | 116 | } else if (selected.label === Interpreter.createVirtualEnvironment) { |
| 117 | + sendTelemetryEvent(EventNames.CREATE_ENVIRONMENT, undefined, { |
| 118 | + manager: 'none', |
| 119 | + triggeredLocation: 'pickEnv', |
| 120 | + }); |
114 | 121 | return createEnvironment(managers, projectEnvManagers, options); |
115 | 122 | } |
116 | 123 | return (selected as { result: PythonEnvironment })?.result; |
|
0 commit comments