File tree Expand file tree Collapse file tree
src/client/pythonEnvironments/base/locators/lowLevel Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -87,6 +87,15 @@ export abstract class FSWatchingLocator extends LazyResourceBasedLocator {
8787 }
8888
8989 protected async initWatchers ( ) : Promise < void > {
90+ // Enable all workspace watchers.
91+ if ( this . watcherKind === FSWatcherKind . Global ) {
92+ // Enable global watchers only if the experiment allows it.
93+ const enableGlobalWatchers = await inExperiment ( DiscoveryVariants . discoverWithFileWatching ) ;
94+ if ( ! enableGlobalWatchers ) {
95+ return ;
96+ }
97+ }
98+
9099 // Start the FS watchers.
91100 let roots = await this . getRoots ( ) ;
92101 if ( typeof roots === 'string' ) {
@@ -104,15 +113,6 @@ export abstract class FSWatchingLocator extends LazyResourceBasedLocator {
104113 } ) ;
105114 const watchableRoots = ( await Promise . all ( promises ) ) . filter ( ( root ) => ! ! root ) as string [ ] ;
106115
107- // Enable all workspace watchers.
108- if ( this . watcherKind === FSWatcherKind . Global ) {
109- // Enable global watchers only if the experiment allows it.
110- const enableGlobalWatchers = await inExperiment ( DiscoveryVariants . discoverWithFileWatching ) ;
111- if ( ! enableGlobalWatchers ) {
112- return ;
113- }
114- }
115-
116116 watchableRoots . forEach ( ( root ) => this . startWatchers ( root ) ) ;
117117 }
118118
You can’t perform that action at this time.
0 commit comments