Skip to content

Commit e396f5b

Browse files
committed
test stub fix
1 parent 6355ebe commit e396f5b

2 files changed

Lines changed: 48 additions & 43 deletions

File tree

src/features/interpreterSelection.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@
22
// Licensed under the MIT License.
33

44
import * as path from 'path';
5-
import { commands, ConfigurationChangeEvent, Disposable, l10n, Uri, workspace } from 'vscode';
5+
import { commands, ConfigurationChangeEvent, Disposable, l10n, Uri } from 'vscode';
66
import { PythonEnvironment, PythonEnvironmentApi } from '../api';
77
import { SYSTEM_MANAGER_ID, VENV_MANAGER_ID } from '../common/constants';
88
import { traceError, traceInfo, traceVerbose, traceWarn } from '../common/logging';
99
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';
1116
import { getUserConfiguredSetting } from '../helpers';
1217
import {
1318
EnvironmentManagers,
@@ -234,7 +239,7 @@ export async function applyInitialEnvironmentSelection(
234239
nativeFinder: NativePythonFinder,
235240
api: PythonEnvironmentApi,
236241
): Promise<void> {
237-
const folders = workspace.workspaceFolders ?? [];
242+
const folders = getWorkspaceFolders() ?? [];
238243
traceInfo(
239244
`[interpreterSelection] Applying initial environment selection for ${folders.length} workspace folder(s)`,
240245
);
@@ -351,7 +356,7 @@ function getProjectSpecificEnvManager(projectManager: PythonProjectManager, scop
351356

352357
if (overrides.length > 0) {
353358
const pw = projectManager.get(scope);
354-
const w = workspace.getWorkspaceFolder(scope);
359+
const w = getWorkspaceFolder(scope);
355360
if (pw && w) {
356361
const pwPath = path.normalize(pw.uri.fsPath);
357362
const matching = overrides.find((s) => path.resolve(w.uri.fsPath, s.path) === pwPath);

0 commit comments

Comments
 (0)