Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export abstract class FSWatchingLocator<I = PythonEnvInfo> 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 });
};

Expand Down
3 changes: 3 additions & 0 deletions src/client/pythonEnvironments/common/externalDependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/client/pythonEnvironments/legacyIOC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down