|
2 | 2 | // Licensed under the MIT License. |
3 | 3 |
|
4 | 4 | import * as path from 'path'; |
5 | | -import { commands, ConfigurationChangeEvent, Disposable, l10n, Uri, workspace } from 'vscode'; |
| 5 | +import { commands, ConfigurationChangeEvent, Disposable, l10n, Uri } from 'vscode'; |
6 | 6 | import { PythonEnvironment, PythonEnvironmentApi } from '../api'; |
7 | 7 | import { SYSTEM_MANAGER_ID, VENV_MANAGER_ID } from '../common/constants'; |
8 | 8 | import { traceError, traceInfo, traceVerbose, traceWarn } from '../common/logging'; |
9 | 9 | import { showWarningMessage } from '../common/window.apis'; |
10 | | -import { getConfiguration, onDidChangeConfiguration } from '../common/workspace.apis'; |
| 10 | +import { |
| 11 | + getConfiguration, |
| 12 | + getWorkspaceFolder, |
| 13 | + getWorkspaceFolders, |
| 14 | + onDidChangeConfiguration, |
| 15 | +} from '../common/workspace.apis'; |
11 | 16 | import { getUserConfiguredSetting } from '../helpers'; |
12 | 17 | import { |
13 | 18 | EnvironmentManagers, |
@@ -234,7 +239,7 @@ export async function applyInitialEnvironmentSelection( |
234 | 239 | nativeFinder: NativePythonFinder, |
235 | 240 | api: PythonEnvironmentApi, |
236 | 241 | ): Promise<void> { |
237 | | - const folders = workspace.workspaceFolders ?? []; |
| 242 | + const folders = getWorkspaceFolders() ?? []; |
238 | 243 | traceInfo( |
239 | 244 | `[interpreterSelection] Applying initial environment selection for ${folders.length} workspace folder(s)`, |
240 | 245 | ); |
@@ -351,7 +356,7 @@ function getProjectSpecificEnvManager(projectManager: PythonProjectManager, scop |
351 | 356 |
|
352 | 357 | if (overrides.length > 0) { |
353 | 358 | const pw = projectManager.get(scope); |
354 | | - const w = workspace.getWorkspaceFolder(scope); |
| 359 | + const w = getWorkspaceFolder(scope); |
355 | 360 | if (pw && w) { |
356 | 361 | const pwPath = path.normalize(pw.uri.fsPath); |
357 | 362 | const matching = overrides.find((s) => path.resolve(w.uri.fsPath, s.path) === pwPath); |
|
0 commit comments