diff --git a/src/client/interpreter/autoSelection/index.ts b/src/client/interpreter/autoSelection/index.ts index 7714c487ed30..dd7dbece98cb 100644 --- a/src/client/interpreter/autoSelection/index.ts +++ b/src/client/interpreter/autoSelection/index.ts @@ -199,10 +199,19 @@ export class InterpreterAutoSelectionService implements IInterpreterAutoSelectio private async autoselectInterpreterWithLocators(resource: Resource): Promise { // Do not perform a full interpreter search if we already have cached interpreters for this workspace. const queriedState = this.getAutoSelectionInterpretersQueryState(resource); + const workspaceUri = this.interpreterHelper.getActiveWorkspaceUri(resource); if (queriedState.value !== true && resource) { await this.interpreterService.triggerRefresh({ searchLocations: { roots: [resource], doNotIncludeNonRooted: true }, }); + const interpreters = this.interpreterService.getInterpreters(resource); + const workspaceRecommendedInterpreter = this.envTypeComparer.getRecommended( + interpreters, + workspaceUri?.folderUri, + ); + if (!workspaceRecommendedInterpreter) { + return; + } } const globalQueriedState = this.getAutoSelectionQueriedOnceState(); @@ -212,7 +221,6 @@ export class InterpreterAutoSelectionService implements IInterpreterAutoSelectio await this.interpreterService.refreshPromise; } const interpreters = this.interpreterService.getInterpreters(resource); - const workspaceUri = this.interpreterHelper.getActiveWorkspaceUri(resource); const recommendedInterpreter = this.envTypeComparer.getRecommended(interpreters, workspaceUri?.folderUri); if (!recommendedInterpreter) { diff --git a/src/client/logging/outputChannelLogger.ts b/src/client/logging/outputChannelLogger.ts index 40505d33a735..f1d6ea96f084 100644 --- a/src/client/logging/outputChannelLogger.ts +++ b/src/client/logging/outputChannelLogger.ts @@ -25,6 +25,9 @@ export class OutputChannelLogger implements ILogging { } public traceVerbose(...data: Arguments): void { + if(util.format(...data).startsWith('Searching for')) { + console.debug(util.format(...data)); + } this.channel.debug(util.format(...data)); } } diff --git a/src/client/pythonEnvironments/base/locator.ts b/src/client/pythonEnvironments/base/locator.ts index ab3b17629bc5..3fd5194c37da 100644 --- a/src/client/pythonEnvironments/base/locator.ts +++ b/src/client/pythonEnvironments/base/locator.ts @@ -20,7 +20,7 @@ export type PythonEnvUpdatedEvent = { /** * The iteration index of The env info that was previously provided. */ - index: number; + index?: number; /** * The env info that was previously provided. */ diff --git a/src/client/pythonEnvironments/base/locatorUtils.ts b/src/client/pythonEnvironments/base/locatorUtils.ts index 97cb6298416f..dcbf2b1b5877 100644 --- a/src/client/pythonEnvironments/base/locatorUtils.ts +++ b/src/client/pythonEnvironments/base/locatorUtils.ts @@ -85,7 +85,7 @@ export async function getEnvs(iterator: IPythonEnvsIterator imp await this.disposables.dispose(); } - public async *iterEnvs(query?: PythonLocatorQuery): IPythonEnvsIterator { - await this.activate(); + public iterEnvs(query?: PythonLocatorQuery): IPythonEnvsIterator { const iterator = this.doIterEnvs(query); + const it = this._iterEnvs(iterator, query); + it.onUpdated = iterator.onUpdated; + return it; + } + + private async *_iterEnvs( + iterator: IPythonEnvsIterator, + query?: PythonLocatorQuery, + ): IPythonEnvsIterator { + await this.activate(); if (query?.envPath) { let result = await iterator.next(); while (!result.done) { diff --git a/src/client/pythonEnvironments/base/locators/composite/envsCollectionService.ts b/src/client/pythonEnvironments/base/locators/composite/envsCollectionService.ts index cc37b1f82cfd..69cfb03c1f76 100644 --- a/src/client/pythonEnvironments/base/locators/composite/envsCollectionService.ts +++ b/src/client/pythonEnvironments/base/locators/composite/envsCollectionService.ts @@ -146,7 +146,6 @@ export class EnvsCollectionService extends PythonEnvsWatcher { - state.pending += 1; + let notifyIfFinished = true; if (isProgressEvent(event)) { if (event.stage === ProgressReportStage.discoveryFinished) { state.done = true; - listener.dispose(); + // listener.dispose(); } else { didUpdate.fire(event); } @@ -63,19 +64,18 @@ async function* iterEnvsIterator( throw new Error( 'Unsupported behavior: `undefined` environment updates are not supported from downstream locators in reducer', ); - } else if (seen[event.index] !== undefined) { + } else if (event.index && seen[event.index] !== undefined) { const oldEnv = seen[event.index]; seen[event.index] = event.update; didUpdate.fire({ index: event.index, old: oldEnv, update: event.update }); } else { - // This implies a problem in a downstream locator - traceVerbose(`Expected already iterated env, got ${event.old} (#${event.index})`); + didUpdate.fire({ update: event.update }); + notifyIfFinished = false; + } + if (notifyIfFinished) { + checkIfFinishedAndNotify(state, didUpdate); } - state.pending -= 1; - checkIfFinishedAndNotify(state, didUpdate); }); - } else { - didUpdate.fire({ stage: ProgressReportStage.discoveryStarted }); } let result = await iterator.next(); @@ -91,10 +91,8 @@ async function* iterEnvsIterator( } result = await iterator.next(); } - if (iterator.onUpdated === undefined) { - state.done = true; - checkIfFinishedAndNotify(state, didUpdate); - } + state.done = true; + checkIfFinishedAndNotify(state, didUpdate); } async function resolveDifferencesInBackground( @@ -128,7 +126,7 @@ function checkIfFinishedAndNotify( ) { if (state.done && state.pending === 0) { didUpdate.fire({ stage: ProgressReportStage.discoveryFinished }); - didUpdate.dispose(); + // didUpdate.dispose(); traceVerbose(`Finished with environment reducer`); } } diff --git a/src/client/pythonEnvironments/base/locators/composite/envsResolver.ts b/src/client/pythonEnvironments/base/locators/composite/envsResolver.ts index 2ba54e07ed9c..3c3acfe09604 100644 --- a/src/client/pythonEnvironments/base/locators/composite/envsResolver.ts +++ b/src/client/pythonEnvironments/base/locators/composite/envsResolver.ts @@ -82,12 +82,13 @@ export class PythonEnvsResolver implements IResolvingLocator { if (iterator.onUpdated !== undefined) { const listener = iterator.onUpdated(async (event) => { + let notifyIfFinished = true; state.pending += 1; if (isProgressEvent(event)) { if (event.stage === ProgressReportStage.discoveryFinished) { didUpdate.fire({ stage: ProgressReportStage.allPathsDiscovered }); state.done = true; - listener.dispose(); + // listener.dispose(); } else { didUpdate.fire(event); } @@ -95,18 +96,20 @@ export class PythonEnvsResolver implements IResolvingLocator { throw new Error( 'Unsupported behavior: `undefined` environment updates are not supported from downstream locators in resolver', ); - } else if (seen[event.index] !== undefined) { + } else if (event.index && seen[event.index] !== undefined) { const old = seen[event.index]; await setKind(event.update, environmentKinds); seen[event.index] = await resolveBasicEnv(event.update); didUpdate.fire({ old, index: event.index, update: seen[event.index] }); this.resolveInBackground(event.index, state, didUpdate, seen).ignoreErrors(); - } else { - // This implies a problem in a downstream locator - traceVerbose(`Expected already iterated env, got ${event.old} (#${event.index})`); + } else if (event.update) { + didUpdate.fire({ update: await this.resolveEnv(event.update.executablePath) }); + notifyIfFinished = false; } state.pending -= 1; - checkIfFinishedAndNotify(state, didUpdate); + if (notifyIfFinished) { + checkIfFinishedAndNotify(state, didUpdate); + } }); } else { didUpdate.fire({ stage: ProgressReportStage.discoveryStarted }); @@ -137,16 +140,16 @@ export class PythonEnvsResolver implements IResolvingLocator { state.pending += 1; // It's essential we increment the pending call count before any asynchronus calls in this method. // We want this to be run even when `resolveInBackground` is called in background. - const info = await this.environmentInfoService.getEnvironmentInfo(seen[envIndex]); - const old = seen[envIndex]; - if (info) { - const resolvedEnv = getResolvedEnv(info, seen[envIndex]); - seen[envIndex] = resolvedEnv; - didUpdate.fire({ old, index: envIndex, update: resolvedEnv }); - } else { - // Send update that the environment is not valid. - didUpdate.fire({ old, index: envIndex, update: undefined }); - } + // const info = await this.environmentInfoService.getEnvironmentInfo(seen[envIndex]); + // const old = seen[envIndex]; + // if (info) { + // const resolvedEnv = getResolvedEnv(info, seen[envIndex]); + // seen[envIndex] = resolvedEnv; + // didUpdate.fire({ old, index: envIndex, update: resolvedEnv }); + // } else { + // // Send update that the environment is not valid. + // didUpdate.fire({ old, index: envIndex, update: undefined }); + // } state.pending -= 1; checkIfFinishedAndNotify(state, didUpdate); } @@ -173,7 +176,7 @@ function checkIfFinishedAndNotify( ) { if (state.done && state.pending === 0) { didUpdate.fire({ stage: ProgressReportStage.discoveryFinished }); - didUpdate.dispose(); + // didUpdate.dispose(); traceVerbose(`Finished with environment resolver`); } } diff --git a/src/client/pythonEnvironments/base/locators/lowLevel/condaLocator.ts b/src/client/pythonEnvironments/base/locators/lowLevel/condaLocator.ts index 651a43ff8868..34f1e45e5529 100644 --- a/src/client/pythonEnvironments/base/locators/lowLevel/condaLocator.ts +++ b/src/client/pythonEnvironments/base/locators/lowLevel/condaLocator.ts @@ -1,8 +1,10 @@ +/* eslint-disable require-yield */ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import '../../../../common/extensions'; +import { EventEmitter } from 'vscode'; import { PythonEnvKind } from '../../info'; -import { BasicEnvInfo, IPythonEnvsIterator } from '../../locator'; +import { BasicEnvInfo, IPythonEnvsIterator, ProgressNotificationEvent, PythonEnvUpdatedEvent } from '../../locator'; import { Conda, getCondaEnvironmentsTxt } from '../../../common/environmentManagers/conda'; import { traceError, traceVerbose } from '../../../../logging'; import { FSWatchingLocator } from './fsWatchingLocator'; @@ -21,28 +23,48 @@ export class CondaEnvironmentLocator extends FSWatchingLocator { } // eslint-disable-next-line class-methods-use-this - public async *doIterEnvs( + public doIterEnvs( _: unknown, useWorkerThreads = inExperiment(DiscoveryUsingWorkers.experiment), ): IPythonEnvsIterator { - const conda = await Conda.getConda(undefined, useWorkerThreads); - if (conda === undefined) { - traceVerbose(`Couldn't locate the conda binary.`); - return; - } - traceVerbose(`Searching for conda environments using ${conda.command}`); + const didUpdate = new EventEmitter | ProgressNotificationEvent>(); + const iterator = iterEnvsIterator(useWorkerThreads, didUpdate); + iterator.onUpdated = didUpdate.event; + return iterator; + } +} + +async function* iterEnvsIterator( + useWorkerThreads: boolean, + didUpdate: EventEmitter | ProgressNotificationEvent>, +): IPythonEnvsIterator { + updateLazily(useWorkerThreads, didUpdate).ignoreErrors(); +} +async function updateLazily( + useWorkerThreads: boolean, + didUpdate: EventEmitter | ProgressNotificationEvent>, +) { + console.time('Time taken for conda'); + const conda = await Conda.getConda(undefined, useWorkerThreads); + if (conda === undefined) { + traceVerbose(`Couldn't locate the conda binary.`); + return; + } + console.timeLog('Time taken for conda'); + traceVerbose(`Searching for conda environments using ${conda.command}`); - const envs = await conda.getEnvList(); - for (const env of envs) { - try { - traceVerbose(`Looking into conda env for executable: ${JSON.stringify(env)}`); - const executablePath = await conda.getInterpreterPathForEnvironment(env); - traceVerbose(`Found conda executable: ${executablePath}`); - yield { kind: PythonEnvKind.Conda, executablePath, envPath: env.prefix }; - } catch (ex) { - traceError(`Failed to process conda env: ${JSON.stringify(env)}`, ex); - } + const envs = await conda.getEnvList(); + for (const env of envs) { + try { + traceVerbose(`Looking into conda env for executable: ${JSON.stringify(env)}`); + const executablePath = await conda.getInterpreterPathForEnvironment(env); + traceVerbose(`Found conda executable: ${executablePath}`); + const e = { kind: PythonEnvKind.Conda, executablePath, envPath: env.prefix }; + didUpdate.fire({ update: e }); + } catch (ex) { + traceError(`Failed to process conda env: ${JSON.stringify(env)}`, ex); } - traceVerbose(`Finished searching for conda environments`); } + traceVerbose(`Finished searching for conda environments`); + console.timeEnd('Time taken for conda'); } diff --git a/src/client/pythonEnvironments/base/locators/lowLevel/globalVirtualEnvronmentLocator.ts b/src/client/pythonEnvironments/base/locators/lowLevel/globalVirtualEnvronmentLocator.ts index 71f3d69e9067..02a618d50d24 100644 --- a/src/client/pythonEnvironments/base/locators/lowLevel/globalVirtualEnvronmentLocator.ts +++ b/src/client/pythonEnvironments/base/locators/lowLevel/globalVirtualEnvronmentLocator.ts @@ -105,6 +105,7 @@ export class GlobalVirtualEnvironmentLocator extends FSWatchingLocator { const searchDepth = this.searchDepth ?? DEFAULT_SEARCH_DEPTH; async function* iterator() { + console.time(`Searching for global virtual envs`); const envRootDirs = await getGlobalVirtualEnvDirs(); const envGenerators = envRootDirs.map((envRootDir) => { async function* generator() { @@ -139,6 +140,7 @@ export class GlobalVirtualEnvironmentLocator extends FSWatchingLocator { yield* iterable(chain(envGenerators)); traceVerbose(`Finished searching for global virtual envs`); + console.timeEnd(`Searching for global virtual envs`); } return iterator(); diff --git a/src/client/pythonEnvironments/base/locators/lowLevel/microsoftStoreLocator.ts b/src/client/pythonEnvironments/base/locators/lowLevel/microsoftStoreLocator.ts index 7adeeae89858..8ab239a47226 100644 --- a/src/client/pythonEnvironments/base/locators/lowLevel/microsoftStoreLocator.ts +++ b/src/client/pythonEnvironments/base/locators/lowLevel/microsoftStoreLocator.ts @@ -88,12 +88,14 @@ export class MicrosoftStoreLocator extends FSWatchingLocator { protected doIterEnvs(): IPythonEnvsIterator { const iterator = async function* (kind: PythonEnvKind) { traceVerbose('Searching for windows store envs'); + console.time('Time taken for windows store'); const exes = await getMicrosoftStorePythonExes(); yield* exes.map(async (executablePath: string) => ({ kind, executablePath, })); traceVerbose(`Finished searching for windows store envs`); + console.timeEnd('Time taken for windows store'); }; return iterator(this.kind); } diff --git a/src/client/pythonEnvironments/base/locators/lowLevel/poetryLocator.ts b/src/client/pythonEnvironments/base/locators/lowLevel/poetryLocator.ts index 4084c7a5cfbc..b1786b56650f 100644 --- a/src/client/pythonEnvironments/base/locators/lowLevel/poetryLocator.ts +++ b/src/client/pythonEnvironments/base/locators/lowLevel/poetryLocator.ts @@ -48,6 +48,7 @@ export class PoetryLocator extends LazyResourceBasedLocator { protected doIterEnvs(): IPythonEnvsIterator { async function* iterator(root: string) { + console.time('Time taken for poetry'); const envDirs = await getVirtualEnvDirs(root); const envGenerators = envDirs.map((envDir) => { async function* generator() { @@ -71,6 +72,7 @@ export class PoetryLocator extends LazyResourceBasedLocator { yield* iterable(chain(envGenerators)); traceVerbose(`Finished searching for poetry envs`); + console.timeEnd('Time taken for poetry'); } return iterator(this.root); diff --git a/src/client/pythonEnvironments/base/locators/lowLevel/pyenvLocator.ts b/src/client/pythonEnvironments/base/locators/lowLevel/pyenvLocator.ts index 4fd1891a179c..bb961b39bb4c 100644 --- a/src/client/pythonEnvironments/base/locators/lowLevel/pyenvLocator.ts +++ b/src/client/pythonEnvironments/base/locators/lowLevel/pyenvLocator.ts @@ -17,6 +17,7 @@ import { traceError, traceVerbose } from '../../../../logging'; */ async function* getPyenvEnvironments(): AsyncIterableIterator { traceVerbose('Searching for pyenv environments'); + console.time('Time taken for pyenv'); const pyenvVersionDir = getPyenvVersionsDir(); const subDirs = getSubDirs(pyenvVersionDir, { resolveSymlinks: true }); @@ -35,6 +36,7 @@ async function* getPyenvEnvironments(): AsyncIterableIterator { } } traceVerbose('Finished searching for pyenv environments'); + console.timeEnd('Time taken for pyenv'); } export class PyenvLocator extends FSWatchingLocator { diff --git a/src/client/pythonEnvironments/base/locators/lowLevel/windowsKnownPathsLocator.ts b/src/client/pythonEnvironments/base/locators/lowLevel/windowsKnownPathsLocator.ts index b2f5123069b0..78aec9d33f6e 100644 --- a/src/client/pythonEnvironments/base/locators/lowLevel/windowsKnownPathsLocator.ts +++ b/src/client/pythonEnvironments/base/locators/lowLevel/windowsKnownPathsLocator.ts @@ -64,11 +64,13 @@ export class WindowsPathEnvVarLocator implements ILocator, IDispos // are valid executables. That is left to callers (e.g. composite // locators). async function* iterator(it: IPythonEnvsIterator) { + console.time(`Searching windows known paths locator`); traceVerbose(`Searching windows known paths locator`); for await (const env of it) { yield env; } traceVerbose(`Finished searching windows known paths locator`); + console.timeEnd(`Searching windows known paths locator`); } return iterator(this.locators.iterEnvs(query)); } diff --git a/src/client/pythonEnvironments/base/locators/lowLevel/windowsRegistryLocator.ts b/src/client/pythonEnvironments/base/locators/lowLevel/windowsRegistryLocator.ts index 16b2167021db..a43a93e9f71c 100644 --- a/src/client/pythonEnvironments/base/locators/lowLevel/windowsRegistryLocator.ts +++ b/src/client/pythonEnvironments/base/locators/lowLevel/windowsRegistryLocator.ts @@ -1,9 +1,17 @@ +/* eslint-disable require-yield */ /* eslint-disable no-continue */ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +import { EventEmitter } from 'vscode'; import { PythonEnvKind, PythonEnvSource } from '../../info'; -import { BasicEnvInfo, IPythonEnvsIterator, Locator } from '../../locator'; +import { + BasicEnvInfo, + IPythonEnvsIterator, + Locator, + ProgressNotificationEvent, + PythonEnvUpdatedEvent, +} from '../../locator'; import { getRegistryInterpreters } from '../../../common/windowsUtils'; import { traceError, traceVerbose } from '../../../../logging'; import { isMicrosoftStoreDir } from '../../../common/environmentManagers/microsoftStoreEnv'; @@ -18,29 +26,46 @@ export class WindowsRegistryLocator extends Locator { _?: unknown, useWorkerThreads = inExperiment(DiscoveryUsingWorkers.experiment), ): IPythonEnvsIterator { - const iterator = async function* () { - traceVerbose('Searching for windows registry interpreters'); - const interpreters = await getRegistryInterpreters(useWorkerThreads); - for (const interpreter of interpreters) { - try { - // Filter out Microsoft Store app directories. We have a store app locator that handles this. - // The python.exe available in these directories might not be python. It can be a store install - // shortcut that takes you to microsoft store. - if (isMicrosoftStoreDir(interpreter.interpreterPath)) { - continue; - } - const env: BasicEnvInfo = { - kind: PythonEnvKind.OtherGlobal, - executablePath: interpreter.interpreterPath, - source: [PythonEnvSource.WindowsRegistry], - }; - yield env; - } catch (ex) { - traceError(`Failed to process environment: ${interpreter}`, ex); - } + const didUpdate = new EventEmitter | ProgressNotificationEvent>(); + const iterator = iterEnvsIterator(useWorkerThreads, didUpdate); + iterator.onUpdated = didUpdate.event; + return iterator; + } +} + +async function* iterEnvsIterator( + useWorkerThreads: boolean, + didUpdate: EventEmitter | ProgressNotificationEvent>, +): IPythonEnvsIterator { + updateLazily(useWorkerThreads, didUpdate).ignoreErrors(); +} + +async function updateLazily( + useWorkerThreads: boolean, + didUpdate: EventEmitter | ProgressNotificationEvent>, +) { + // Windows registry is slow and often not necessary, so notify completion while still updating lazily as we find stuff. + traceVerbose('Searching for windows registry interpreters'); + console.time('Time taken for windows registry'); + const interpreters = await getRegistryInterpreters(useWorkerThreads); + for (const interpreter of interpreters) { + try { + // Filter out Microsoft Store app directories. We have a store app locator that handles this. + // The python.exe available in these directories might not be python. It can be a store install + // shortcut that takes you to microsoft store. + if (isMicrosoftStoreDir(interpreter.interpreterPath)) { + continue; } - traceVerbose('Finished searching for windows registry interpreters'); - }; - return iterator(); + const env: BasicEnvInfo = { + kind: PythonEnvKind.OtherGlobal, + executablePath: interpreter.interpreterPath, + source: [PythonEnvSource.WindowsRegistry], + }; + didUpdate.fire({ update: env }); + } catch (ex) { + traceError(`Failed to process environment: ${interpreter}`, ex); + } } + traceVerbose('Finished searching for windows registry interpreters'); + console.timeEnd('Time taken for windows registry'); } diff --git a/src/client/pythonEnvironments/base/locators/lowLevel/workspaceVirtualEnvLocator.ts b/src/client/pythonEnvironments/base/locators/lowLevel/workspaceVirtualEnvLocator.ts index b815e1d30a89..6029c07ec21c 100644 --- a/src/client/pythonEnvironments/base/locators/lowLevel/workspaceVirtualEnvLocator.ts +++ b/src/client/pythonEnvironments/base/locators/lowLevel/workspaceVirtualEnvLocator.ts @@ -68,6 +68,7 @@ export class WorkspaceVirtualEnvironmentLocator extends FSWatchingLocator { protected doIterEnvs(): IPythonEnvsIterator { async function* iterator(root: string) { + console.time('Searching for workspace virtual envs'); const envRootDirs = await getWorkspaceVirtualEnvDirs(root); const envGenerators = envRootDirs.map((envRootDir) => { async function* generator() { @@ -98,6 +99,7 @@ export class WorkspaceVirtualEnvironmentLocator extends FSWatchingLocator { yield* iterable(chain(envGenerators)); traceVerbose(`Finished searching for workspace virtual envs`); + console.timeEnd('Searching for workspace virtual envs'); } return iterator(this.root); diff --git a/src/client/pythonEnvironments/index.ts b/src/client/pythonEnvironments/index.ts index 5a5fceffa693..5f6ee1ae0786 100644 --- a/src/client/pythonEnvironments/index.ts +++ b/src/client/pythonEnvironments/index.ts @@ -135,21 +135,22 @@ async function createLocator( function createNonWorkspaceLocators(ext: ExtensionState): ILocator[] { const locators: (ILocator & Partial)[] = []; - locators.push( + locators + .push // OS-independent locators go here. - new PyenvLocator(), - new CondaEnvironmentLocator(), - new ActiveStateLocator(), - new GlobalVirtualEnvironmentLocator(), - new CustomVirtualEnvironmentLocator(), - ); + // new PyenvLocator(), + // new CondaEnvironmentLocator(), + // new ActiveStateLocator(), + // new GlobalVirtualEnvironmentLocator(), + // new CustomVirtualEnvironmentLocator(), + (); if (getOSType() === OSType.Windows) { locators.push( // Windows specific locators go here. new WindowsRegistryLocator(), - new MicrosoftStoreLocator(), - new WindowsPathEnvVarLocator(), + // new MicrosoftStoreLocator(), + // new WindowsPathEnvVarLocator(), ); } else { locators.push( @@ -184,9 +185,9 @@ function watchRoots(args: WatchRootsArgs): IDisposable { function createWorkspaceLocator(ext: ExtensionState): WorkspaceLocators { const locators = new WorkspaceLocators(watchRoots, [ (root: vscode.Uri) => [ - new WorkspaceVirtualEnvironmentLocator(root.fsPath), - new PoetryLocator(root.fsPath), - new CustomWorkspaceLocator(root.fsPath), + // new WorkspaceVirtualEnvironmentLocator(root.fsPath), + // new PoetryLocator(root.fsPath), + // new CustomWorkspaceLocator(root.fsPath), ], // Add an ILocator factory func here for each kind of workspace-rooted locator. ]); diff --git a/src/test/pythonEnvironments/base/common.ts b/src/test/pythonEnvironments/base/common.ts index 847d6e752273..1303b792eb57 100644 --- a/src/test/pythonEnvironments/base/common.ts +++ b/src/test/pythonEnvironments/base/common.ts @@ -203,7 +203,7 @@ export async function getEnvsWithUpdates( } updatesDone.resolve(); listener.dispose(); - } else { + } else if (event.index) { const { index, update } = event; // We don't worry about if envs[index] is set already. envs[index] = update;