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 {
196196}
197197
198198function 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+ }
206210 }
211+ } catch ( e ) {
212+ console . warn ( 'Error reading directory: ' + path + ', ignoring it' ) ;
213+ return ;
207214 }
208215}
209216
You can’t perform that action at this time.
0 commit comments