Skip to content

Commit 8b00403

Browse files
author
Kartik Raj
committed
more logging
1 parent 2af3e7d commit 8b00403

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/client/common/platform/fileSystemWatcher.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export function watchLocationForPattern(
2727
): IDisposable {
2828
// Use VSCode API iff base directory to exists within the current workspace folders
2929
const found = workspace.workspaceFolders?.find((e) => normCasePath(baseDir).startsWith(normCasePath(e.uri.fsPath)));
30+
traceVerbose('Creating filewatcher', baseDir, pattern, JSON.stringify(workspace.workspaceFolders), found);
3031
if (found) {
3132
return watchLocationUsingVSCodeAPI(baseDir, pattern, callback);
3233
}

src/client/pythonEnvironments/base/locators/lowLevel/fsWatchingLocator.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import * as fs from 'fs';
55
import * as path from 'path';
66
import { Uri } from 'vscode';
77
import { DiscoveryVariants } from '../../../../common/experiments/groups';
8+
import { traceVerbose } from '../../../../common/logger';
89
import { FileChangeType } from '../../../../common/platform/fileSystemWatcher';
910
import { sleep } from '../../../../common/utils/async';
1011
import { logError } from '../../../../logging';
@@ -112,11 +113,12 @@ export abstract class FSWatchingLocator<I = PythonEnvInfo> extends LazyResourceB
112113
return root;
113114
});
114115
const watchableRoots = (await Promise.all(promises)).filter((root) => !!root) as string[];
115-
116+
traceVerbose('Start watching roots');
116117
watchableRoots.forEach((root) => this.startWatchers(root));
117118
}
118119

119120
private startWatchers(root: string): void {
121+
traceVerbose('Start watching root', root);
120122
const callback = async (type: FileChangeType, executable: string) => {
121123
if (type === FileChangeType.Created) {
122124
if (this.opts.delayOnCreated !== undefined) {
@@ -142,11 +144,13 @@ export abstract class FSWatchingLocator<I = PythonEnvInfo> extends LazyResourceB
142144
this.emitter.fire({ type, kind, searchLocation });
143145
};
144146

147+
traceVerbose('I am here1', root);
145148
const globs = resolvePythonExeGlobs(
146149
this.opts.baseGlob,
147150
// The structure determines which globs are returned.
148151
this.opts.envStructure,
149152
);
153+
traceVerbose('I am here2', root, globs);
150154
const watchers = globs.map((g) => watchLocationForPythonBinaries(root, callback, g));
151155
this.disposables.push(...watchers);
152156
}

0 commit comments

Comments
 (0)