Skip to content

Commit 64321b7

Browse files
author
Kartik Raj
committed
asas
1 parent 8b00403 commit 64321b7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ function checkDirWatchable(dirname: string): DirUnwatchableReason {
3434
try {
3535
names = fs.readdirSync(dirname);
3636
} catch (err) {
37+
traceVerbose('haha', err);
3738
if (err.code === 'ENOENT') {
3839
// We treat a missing directory as watchable since it should
3940
// be watchable if created later.
@@ -43,8 +44,10 @@ function checkDirWatchable(dirname: string): DirUnwatchableReason {
4344
}
4445
// The limit here is an educated guess.
4546
if (names.length > 200) {
47+
traceVerbose('say what');
4648
return 'too many files';
4749
}
50+
traceVerbose('yep');
4851
return undefined;
4952
}
5053

@@ -89,6 +92,7 @@ export abstract class FSWatchingLocator<I = PythonEnvInfo> extends LazyResourceB
8992

9093
protected async initWatchers(): Promise<void> {
9194
// Enable all workspace watchers.
95+
traceVerbose('I am here12');
9296
if (this.watcherKind === FSWatcherKind.Global) {
9397
// Enable global watchers only if the experiment allows it.
9498
const enableGlobalWatchers = await inExperiment(DiscoveryVariants.discoverWithFileWatching);
@@ -98,22 +102,26 @@ export abstract class FSWatchingLocator<I = PythonEnvInfo> extends LazyResourceB
98102
}
99103

100104
// Start the FS watchers.
105+
traceVerbose('getting roots');
101106
let roots = await this.getRoots();
107+
traceVerbose('found roots');
102108
if (typeof roots === 'string') {
103109
roots = [roots];
104110
}
105111
const promises = roots.map(async (root) => {
106112
// Note that we only check the root dir. Any directories
107113
// that might be watched due to a glob are not checked.
114+
traceVerbose('Hellow there0', root);
108115
const unwatchable = await checkDirWatchable(root);
109116
if (unwatchable) {
110117
logError(`dir "${root}" is not watchable (${unwatchable})`);
111118
return undefined;
112119
}
120+
traceVerbose('Hellow there', root);
113121
return root;
114122
});
115123
const watchableRoots = (await Promise.all(promises)).filter((root) => !!root) as string[];
116-
traceVerbose('Start watching roots');
124+
traceVerbose('Start watching roots', JSON.stringify(watchableRoots));
117125
watchableRoots.forEach((root) => this.startWatchers(root));
118126
}
119127

0 commit comments

Comments
 (0)