@@ -34,6 +34,7 @@ function checkDirWatchable(dirname: string): DirUnwatchableReason {
34
34
try {
35
35
names = fs . readdirSync ( dirname ) ;
36
36
} catch ( err ) {
37
+ traceVerbose ( 'haha' , err ) ;
37
38
if ( err . code === 'ENOENT' ) {
38
39
// We treat a missing directory as watchable since it should
39
40
// be watchable if created later.
@@ -43,8 +44,10 @@ function checkDirWatchable(dirname: string): DirUnwatchableReason {
43
44
}
44
45
// The limit here is an educated guess.
45
46
if ( names . length > 200 ) {
47
+ traceVerbose ( 'say what' ) ;
46
48
return 'too many files' ;
47
49
}
50
+ traceVerbose ( 'yep' ) ;
48
51
return undefined ;
49
52
}
50
53
@@ -89,6 +92,7 @@ export abstract class FSWatchingLocator<I = PythonEnvInfo> extends LazyResourceB
89
92
90
93
protected async initWatchers ( ) : Promise < void > {
91
94
// Enable all workspace watchers.
95
+ traceVerbose ( 'I am here12' ) ;
92
96
if ( this . watcherKind === FSWatcherKind . Global ) {
93
97
// Enable global watchers only if the experiment allows it.
94
98
const enableGlobalWatchers = await inExperiment ( DiscoveryVariants . discoverWithFileWatching ) ;
@@ -98,22 +102,26 @@ export abstract class FSWatchingLocator<I = PythonEnvInfo> extends LazyResourceB
98
102
}
99
103
100
104
// Start the FS watchers.
105
+ traceVerbose ( 'getting roots' ) ;
101
106
let roots = await this . getRoots ( ) ;
107
+ traceVerbose ( 'found roots' ) ;
102
108
if ( typeof roots === 'string' ) {
103
109
roots = [ roots ] ;
104
110
}
105
111
const promises = roots . map ( async ( root ) => {
106
112
// Note that we only check the root dir. Any directories
107
113
// that might be watched due to a glob are not checked.
114
+ traceVerbose ( 'Hellow there0' , root ) ;
108
115
const unwatchable = await checkDirWatchable ( root ) ;
109
116
if ( unwatchable ) {
110
117
logError ( `dir "${ root } " is not watchable (${ unwatchable } )` ) ;
111
118
return undefined ;
112
119
}
120
+ traceVerbose ( 'Hellow there' , root ) ;
113
121
return root ;
114
122
} ) ;
115
123
const watchableRoots = ( await Promise . all ( promises ) ) . filter ( ( root ) => ! ! root ) as string [ ] ;
116
- traceVerbose ( 'Start watching roots' ) ;
124
+ traceVerbose ( 'Start watching roots' , JSON . stringify ( watchableRoots ) ) ;
117
125
watchableRoots . forEach ( ( root ) => this . startWatchers ( root ) ) ;
118
126
}
119
127
0 commit comments