Skip to content
Merged
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 @@ -87,6 +87,15 @@ export abstract class FSWatchingLocator extends LazyResourceBasedLocator {
}

protected async initWatchers(): Promise<void> {
// Enable all workspace watchers.
if (this.watcherKind === FSWatcherKind.Global) {
// Enable global watchers only if the experiment allows it.
const enableGlobalWatchers = await inExperiment(DiscoveryVariants.discoverWithFileWatching);
if (!enableGlobalWatchers) {
return;
}
}

// Start the FS watchers.
let roots = await this.getRoots();
if (typeof roots === 'string') {
Expand All @@ -104,15 +113,6 @@ export abstract class FSWatchingLocator extends LazyResourceBasedLocator {
});
const watchableRoots = (await Promise.all(promises)).filter((root) => !!root) as string[];

// Enable all workspace watchers.
if (this.watcherKind === FSWatcherKind.Global) {
// Enable global watchers only if the experiment allows it.
const enableGlobalWatchers = await inExperiment(DiscoveryVariants.discoverWithFileWatching);
if (!enableGlobalWatchers) {
return;
}
}

watchableRoots.forEach((root) => this.startWatchers(root));
}

Expand Down