diff --git a/src/client/pythonEnvironments/base/locators/lowLevel/fsWatchingLocator.ts b/src/client/pythonEnvironments/base/locators/lowLevel/fsWatchingLocator.ts index fab78d42de05..7181ec975eea 100644 --- a/src/client/pythonEnvironments/base/locators/lowLevel/fsWatchingLocator.ts +++ b/src/client/pythonEnvironments/base/locators/lowLevel/fsWatchingLocator.ts @@ -143,6 +143,7 @@ export abstract class FSWatchingLocator extends LazyResourceB const searchLocation = Uri.file( this.opts.searchLocation ?? path.dirname(getEnvironmentDirFromPath(executable)), ); + traceVerbose('Fired event ', JSON.stringify({ type, kind, searchLocation }), 'from locator'); this.emitter.fire({ type, kind, searchLocation }); }; diff --git a/src/client/pythonEnvironments/common/externalDependencies.ts b/src/client/pythonEnvironments/common/externalDependencies.ts index 27f5cea2ee4d..058f0fb59d15 100644 --- a/src/client/pythonEnvironments/common/externalDependencies.ts +++ b/src/client/pythonEnvironments/common/externalDependencies.ts @@ -85,6 +85,9 @@ export function isParentPath(filePath: string, parentPath: string): boolean { if (!parentPath.endsWith(path.sep)) { parentPath += path.sep; } + if (!filePath.endsWith(path.sep)) { + filePath += path.sep; + } return normCasePath(filePath).startsWith(normCasePath(parentPath)); } diff --git a/src/client/pythonEnvironments/common/pythonBinariesWatcher.ts b/src/client/pythonEnvironments/common/pythonBinariesWatcher.ts index 364157b02fb0..3cdf9860814b 100644 --- a/src/client/pythonEnvironments/common/pythonBinariesWatcher.ts +++ b/src/client/pythonEnvironments/common/pythonBinariesWatcher.ts @@ -27,7 +27,7 @@ export function watchLocationForPythonBinaries( const resolvedGlob = path.posix.normalize(executableGlob); const [baseGlob] = resolvedGlob.split('/').slice(-1); function callbackClosure(type: FileChangeType, e: string) { - traceVerbose('Received event', JSON.stringify(e), 'for baseglob', baseGlob); + traceVerbose('Received event', type, JSON.stringify(e), 'for baseglob', baseGlob); const isMatch = minimatch(path.basename(e), baseGlob, { nocase: getOSType() === OSType.Windows }); if (!isMatch) { // When deleting the file for some reason path to all directories leading up to python are reported diff --git a/src/client/pythonEnvironments/legacyIOC.ts b/src/client/pythonEnvironments/legacyIOC.ts index 25ea840d8976..0b18fb2c11e3 100644 --- a/src/client/pythonEnvironments/legacyIOC.ts +++ b/src/client/pythonEnvironments/legacyIOC.ts @@ -5,7 +5,7 @@ import { injectable } from 'inversify'; import { intersection } from 'lodash'; import * as vscode from 'vscode'; import { DiscoveryVariants } from '../common/experiments/groups'; -import { traceError } from '../common/logger'; +import { traceError, traceVerbose } from '../common/logger'; import { FileChangeType } from '../common/platform/fileSystemWatcher'; import { Resource } from '../common/types'; import { @@ -177,6 +177,7 @@ class ComponentAdapter implements IComponentAdapter { if (!workspaceFolder || !e.searchLocation) { return; } + traceVerbose(`Recieved event ${JSON.stringify(e)} file change event`); if ( e.type === FileChangeType.Created && isParentPath(e.searchLocation.fsPath, workspaceFolder.uri.fsPath)