File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
src/languageservice/services Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -196,14 +196,21 @@ function registerFile(path: string): void {
196
196
}
197
197
198
198
function registerWorkspaceFiles ( path : string ) : void {
199
- const files = readdirSync ( path ) ;
200
- for ( const file of files ) {
201
- const filePath = path + '/' + file ;
202
- if ( file . endsWith ( '.yaml' ) || file . endsWith ( '.yml' ) ) {
203
- registerFile ( filePath ) ;
204
- } else if ( statSync ( filePath ) . isDirectory ( ) ) {
205
- registerWorkspaceFiles ( filePath ) ;
199
+ try {
200
+ const files = readdirSync ( path ) ;
201
+ for ( const file of files ) {
202
+ const filePath = path + '/' + file ;
203
+ const stats = statSync ( filePath ) ;
204
+
205
+ if ( file . endsWith ( '.yaml' ) || file . endsWith ( '.yml' ) ) {
206
+ registerFile ( filePath ) ;
207
+ } else if ( stats . isDirectory ( ) ) {
208
+ registerWorkspaceFiles ( filePath ) ;
209
+ }
206
210
}
211
+ } catch ( e ) {
212
+ console . warn ( 'Error reading directory: ' + path + ', ignoring it' ) ;
213
+ return ;
207
214
}
208
215
}
209
216
You can’t perform that action at this time.
0 commit comments