diff --git a/src/client/pythonEnvironments/base/locators/composite/envsReducer.ts b/src/client/pythonEnvironments/base/locators/composite/envsReducer.ts index 2f9bcea8e590..49f5b619694e 100644 --- a/src/client/pythonEnvironments/base/locators/composite/envsReducer.ts +++ b/src/client/pythonEnvironments/base/locators/composite/envsReducer.ts @@ -129,6 +129,7 @@ function checkIfFinishedAndNotify( if (state.done && state.pending === 0) { didUpdate.fire({ stage: ProgressReportStage.discoveryFinished }); 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 4d68370ea262..2ba54e07ed9c 100644 --- a/src/client/pythonEnvironments/base/locators/composite/envsResolver.ts +++ b/src/client/pythonEnvironments/base/locators/composite/envsResolver.ts @@ -174,6 +174,7 @@ function checkIfFinishedAndNotify( if (state.done && state.pending === 0) { didUpdate.fire({ stage: ProgressReportStage.discoveryFinished }); didUpdate.dispose(); + traceVerbose(`Finished with environment resolver`); } } diff --git a/src/client/pythonEnvironments/base/locators/lowLevel/activestateLocator.ts b/src/client/pythonEnvironments/base/locators/lowLevel/activeStateLocator.ts similarity index 96% rename from src/client/pythonEnvironments/base/locators/lowLevel/activestateLocator.ts rename to src/client/pythonEnvironments/base/locators/lowLevel/activeStateLocator.ts index 315f8e283d85..987abf4f4157 100644 --- a/src/client/pythonEnvironments/base/locators/lowLevel/activestateLocator.ts +++ b/src/client/pythonEnvironments/base/locators/lowLevel/activeStateLocator.ts @@ -40,5 +40,6 @@ export class ActiveStateLocator extends LazyResourceBasedLocator { } } } + traceVerbose(`Finished searching for active state environments`); } } diff --git a/src/client/pythonEnvironments/base/locators/lowLevel/condaLocator.ts b/src/client/pythonEnvironments/base/locators/lowLevel/condaLocator.ts index a355a72d5336..7cac0cb7df90 100644 --- a/src/client/pythonEnvironments/base/locators/lowLevel/condaLocator.ts +++ b/src/client/pythonEnvironments/base/locators/lowLevel/condaLocator.ts @@ -38,5 +38,6 @@ export class CondaEnvironmentLocator extends FSWatchingLocator { traceError(`Failed to process conda env: ${JSON.stringify(env)}`, ex); } } + traceVerbose(`Finished searching for conda environments`); } } diff --git a/src/client/pythonEnvironments/base/locators/lowLevel/customVirtualEnvLocator.ts b/src/client/pythonEnvironments/base/locators/lowLevel/customVirtualEnvLocator.ts index 06cbfe38ee3c..57ae9187cdc2 100644 --- a/src/client/pythonEnvironments/base/locators/lowLevel/customVirtualEnvLocator.ts +++ b/src/client/pythonEnvironments/base/locators/lowLevel/customVirtualEnvLocator.ts @@ -132,6 +132,7 @@ export class CustomVirtualEnvironmentLocator extends FSWatchingLocator { }); yield* iterable(chain(envGenerators)); + traceVerbose(`Finished searching for custom virtual envs`); } return iterator(); diff --git a/src/client/pythonEnvironments/base/locators/lowLevel/globalVirtualEnvronmentLocator.ts b/src/client/pythonEnvironments/base/locators/lowLevel/globalVirtualEnvronmentLocator.ts index cddec23f7b0b..d86b2182d50c 100644 --- a/src/client/pythonEnvironments/base/locators/lowLevel/globalVirtualEnvronmentLocator.ts +++ b/src/client/pythonEnvironments/base/locators/lowLevel/globalVirtualEnvronmentLocator.ts @@ -134,6 +134,7 @@ export class GlobalVirtualEnvironmentLocator extends FSWatchingLocator { }); yield* iterable(chain(envGenerators)); + traceVerbose(`Finished 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 6b8e5ac0084c..9b5283f7f967 100644 --- a/src/client/pythonEnvironments/base/locators/lowLevel/microsoftStoreLocator.ts +++ b/src/client/pythonEnvironments/base/locators/lowLevel/microsoftStoreLocator.ts @@ -12,6 +12,7 @@ import { isStorePythonInstalled, getMicrosoftStoreAppsRoot, } from '../../../common/environmentManagers/microsoftStoreEnv'; +import { traceVerbose } from '../../../../logging'; /** * This is a glob pattern which matches following file names: @@ -91,6 +92,7 @@ export class MicrosoftStoreLocator extends FSWatchingLocator { kind, executablePath, })); + traceVerbose(`Finished searching for windows store envs`); }; 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 0b210c05b6a1..4084c7a5cfbc 100644 --- a/src/client/pythonEnvironments/base/locators/lowLevel/poetryLocator.ts +++ b/src/client/pythonEnvironments/base/locators/lowLevel/poetryLocator.ts @@ -70,6 +70,7 @@ export class PoetryLocator extends LazyResourceBasedLocator { }); yield* iterable(chain(envGenerators)); + traceVerbose(`Finished searching for poetry envs`); } return iterator(this.root); diff --git a/src/client/pythonEnvironments/base/locators/lowLevel/posixKnownPathsLocator.ts b/src/client/pythonEnvironments/base/locators/lowLevel/posixKnownPathsLocator.ts index 25923701c05a..97726307c573 100644 --- a/src/client/pythonEnvironments/base/locators/lowLevel/posixKnownPathsLocator.ts +++ b/src/client/pythonEnvironments/base/locators/lowLevel/posixKnownPathsLocator.ts @@ -8,8 +8,8 @@ import { BasicEnvInfo, IPythonEnvsIterator, Locator } from '../../locator'; import { commonPosixBinPaths, getPythonBinFromPosixPaths } from '../../../common/posixUtils'; import { isPyenvShimDir } from '../../../common/environmentManagers/pyenv'; import { getOSType, OSType } from '../../../../common/utils/platform'; -import { isMacDefaultPythonPath } from './macDefaultLocator'; -import { traceError } from '../../../../logging'; +import { isMacDefaultPythonPath } from '../../../common/environmentManagers/macDefault'; +import { traceError, traceVerbose } from '../../../../logging'; export class PosixKnownPathsLocator extends Locator { public readonly providerId = 'posixKnownPaths'; @@ -44,6 +44,7 @@ export class PosixKnownPathsLocator extends Locator { traceError(`Failed to process environment: ${bin}`, ex); } } + traceVerbose('Finished searching for interpreters in posix paths locator'); }; return iterator(this.kind); } diff --git a/src/client/pythonEnvironments/base/locators/lowLevel/pyenvLocator.ts b/src/client/pythonEnvironments/base/locators/lowLevel/pyenvLocator.ts index 89346069772d..dc3290c9993c 100644 --- a/src/client/pythonEnvironments/base/locators/lowLevel/pyenvLocator.ts +++ b/src/client/pythonEnvironments/base/locators/lowLevel/pyenvLocator.ts @@ -7,7 +7,7 @@ import { FSWatchingLocator } from './fsWatchingLocator'; import { getInterpreterPathFromDir } from '../../../common/commonUtils'; import { getSubDirs } from '../../../common/externalDependencies'; import { getPyenvVersionsDir } from '../../../common/environmentManagers/pyenv'; -import { traceError } from '../../../../logging'; +import { traceError, traceVerbose } from '../../../../logging'; /** * Gets all the pyenv environments. @@ -33,6 +33,7 @@ async function* getPyenvEnvironments(): AsyncIterableIterator { } } } + traceVerbose('Finished searching for pyenv environments'); } 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 b7cb27875769..377b1117b858 100644 --- a/src/client/pythonEnvironments/base/locators/lowLevel/windowsKnownPathsLocator.ts +++ b/src/client/pythonEnvironments/base/locators/lowLevel/windowsKnownPathsLocator.ts @@ -16,6 +16,7 @@ import { Locators } from '../../locators'; import { getEnvs } from '../../locatorUtils'; import { PythonEnvsChangedEvent } from '../../watcher'; import { DirFilesLocator } from './filesLocator'; +import { traceVerbose } from '../../../../logging'; /** * A locator for Windows locators found under the $PATH env var. @@ -93,6 +94,7 @@ function getDirFilesLocator( // take a naive approach. async function* iterEnvs(query: PythonLocatorQuery): IPythonEnvsIterator { yield* await getEnvs(locator.iterEnvs(query)); + traceVerbose('Finished searching for windows path interpreters'); } return { providerId: locator.providerId, diff --git a/src/client/pythonEnvironments/base/locators/lowLevel/windowsRegistryLocator.ts b/src/client/pythonEnvironments/base/locators/lowLevel/windowsRegistryLocator.ts index d589231cc7ca..954d1bfd2a41 100644 --- a/src/client/pythonEnvironments/base/locators/lowLevel/windowsRegistryLocator.ts +++ b/src/client/pythonEnvironments/base/locators/lowLevel/windowsRegistryLocator.ts @@ -5,7 +5,7 @@ import { PythonEnvKind, PythonEnvSource } from '../../info'; import { BasicEnvInfo, IPythonEnvsIterator, Locator } from '../../locator'; import { getRegistryInterpreters } from '../../../common/windowsUtils'; -import { traceError } from '../../../../logging'; +import { traceError, traceVerbose } from '../../../../logging'; import { isMicrosoftStoreDir } from '../../../common/environmentManagers/microsoftStoreEnv'; export class WindowsRegistryLocator extends Locator { @@ -33,6 +33,7 @@ export class WindowsRegistryLocator extends Locator { traceError(`Failed to process environment: ${interpreter}`, ex); } } + traceVerbose('Finished searching for windows registry interpreters'); }; return iterator(); } diff --git a/src/client/pythonEnvironments/base/locators/lowLevel/workspaceVirtualEnvLocator.ts b/src/client/pythonEnvironments/base/locators/lowLevel/workspaceVirtualEnvLocator.ts index 127515607563..b815e1d30a89 100644 --- a/src/client/pythonEnvironments/base/locators/lowLevel/workspaceVirtualEnvLocator.ts +++ b/src/client/pythonEnvironments/base/locators/lowLevel/workspaceVirtualEnvLocator.ts @@ -97,6 +97,7 @@ export class WorkspaceVirtualEnvironmentLocator extends FSWatchingLocator { }); yield* iterable(chain(envGenerators)); + traceVerbose(`Finished searching for workspace virtual envs`); } return iterator(this.root); diff --git a/src/client/pythonEnvironments/base/locators/lowLevel/macDefaultLocator.ts b/src/client/pythonEnvironments/common/environmentManagers/macDefault.ts similarity index 75% rename from src/client/pythonEnvironments/base/locators/lowLevel/macDefaultLocator.ts rename to src/client/pythonEnvironments/common/environmentManagers/macDefault.ts index abb8652b23a1..931fbbba9eac 100644 --- a/src/client/pythonEnvironments/base/locators/lowLevel/macDefaultLocator.ts +++ b/src/client/pythonEnvironments/common/environmentManagers/macDefault.ts @@ -1,9 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { getOSType, OSType } from '../../../../common/utils/platform'; - -// TODO: Add tests for 'isMacDefaultPythonPath' when working on the locator +import { getOSType, OSType } from '../../../common/utils/platform'; /** * Decide if the given Python executable looks like the MacOS default Python. diff --git a/src/client/pythonEnvironments/index.ts b/src/client/pythonEnvironments/index.ts index 8d6a8cb7d4ba..8065811a8a62 100644 --- a/src/client/pythonEnvironments/index.ts +++ b/src/client/pythonEnvironments/index.ts @@ -36,7 +36,7 @@ import { import { EnvsCollectionService } from './base/locators/composite/envsCollectionService'; import { IDisposable } from '../common/types'; import { traceError } from '../logging'; -import { ActiveStateLocator } from './base/locators/lowLevel/activestateLocator'; +import { ActiveStateLocator } from './base/locators/lowLevel/activeStateLocator'; /** * Set up the Python environments component (during extension activation).' diff --git a/src/client/pythonEnvironments/legacyIOC.ts b/src/client/pythonEnvironments/legacyIOC.ts index ce9bfb4caf11..0c80c3414728 100644 --- a/src/client/pythonEnvironments/legacyIOC.ts +++ b/src/client/pythonEnvironments/legacyIOC.ts @@ -10,7 +10,7 @@ import { IComponentAdapter, ICondaService, PythonEnvironmentsChangedEvent } from import { IServiceManager } from '../ioc/types'; import { PythonEnvInfo, PythonEnvKind, PythonEnvSource } from './base/info'; import { IDiscoveryAPI, PythonLocatorQuery, TriggerRefreshOptions } from './base/locator'; -import { isMacDefaultPythonPath } from './base/locators/lowLevel/macDefaultLocator'; +import { isMacDefaultPythonPath } from './common/environmentManagers/macDefault'; import { isParentPath } from './common/externalDependencies'; import { EnvironmentType, PythonEnvironment } from './info'; import { toSemverLikeVersion } from './base/info/pythonVersion'; diff --git a/src/test/pythonEnvironments/base/locators/lowLevel/activestateLocator.unit.test.ts b/src/test/pythonEnvironments/base/locators/lowLevel/activestateLocator.unit.test.ts index 5bdbd22def0f..bf86db883433 100644 --- a/src/test/pythonEnvironments/base/locators/lowLevel/activestateLocator.unit.test.ts +++ b/src/test/pythonEnvironments/base/locators/lowLevel/activestateLocator.unit.test.ts @@ -7,7 +7,7 @@ import * as fsapi from 'fs-extra'; import { PythonEnvKind } from '../../../../../client/pythonEnvironments/base/info'; import * as externalDependencies from '../../../../../client/pythonEnvironments/common/externalDependencies'; import { getEnvs } from '../../../../../client/pythonEnvironments/base/locatorUtils'; -import { ActiveStateLocator } from '../../../../../client/pythonEnvironments/base/locators/lowLevel/activestateLocator'; +import { ActiveStateLocator } from '../../../../../client/pythonEnvironments/base/locators/lowLevel/activeStateLocator'; import { TEST_LAYOUT_ROOT } from '../../../common/commonTestConstants'; import { assertBasicEnvsEqual } from '../envTestUtils'; import { ExecutionResult } from '../../../../../client/common/process/types'; diff --git a/src/test/pythonEnvironments/base/locators/lowLevel/macDefaultLocator.unit.test.ts b/src/test/pythonEnvironments/base/locators/lowLevel/macDefaultLocator.unit.test.ts index 56012e11e4c5..62339df7e144 100644 --- a/src/test/pythonEnvironments/base/locators/lowLevel/macDefaultLocator.unit.test.ts +++ b/src/test/pythonEnvironments/base/locators/lowLevel/macDefaultLocator.unit.test.ts @@ -4,7 +4,7 @@ import * as assert from 'assert'; import * as sinon from 'sinon'; import * as osUtils from '../../../../../client/common/utils/platform'; -import { isMacDefaultPythonPath } from '../../../../../client/pythonEnvironments/base/locators/lowLevel/macDefaultLocator'; +import { isMacDefaultPythonPath } from '../../../../../client/pythonEnvironments/common/environmentManagers/macDefault'; suite('isMacDefaultPythonPath', () => { let getOSTypeStub: sinon.SinonStub; diff --git a/src/test/pythonEnvironments/base/locators/lowLevel/posixKnownPathsLocator.unit.test.ts b/src/test/pythonEnvironments/base/locators/lowLevel/posixKnownPathsLocator.unit.test.ts index 89ab4402b3b6..7a9a2bc6475d 100644 --- a/src/test/pythonEnvironments/base/locators/lowLevel/posixKnownPathsLocator.unit.test.ts +++ b/src/test/pythonEnvironments/base/locators/lowLevel/posixKnownPathsLocator.unit.test.ts @@ -14,7 +14,7 @@ import { PosixKnownPathsLocator } from '../../../../../client/pythonEnvironments import { createBasicEnv } from '../../common'; import { TEST_LAYOUT_ROOT } from '../../../common/commonTestConstants'; import { assertBasicEnvsEqual } from '../envTestUtils'; -import { isMacDefaultPythonPath } from '../../../../../client/pythonEnvironments/base/locators/lowLevel/macDefaultLocator'; +import { isMacDefaultPythonPath } from '../../../../../client/pythonEnvironments/common/environmentManagers/macDefault'; suite('Posix Known Path Locator', () => { let getPathEnvVar: sinon.SinonStub;