File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
packages/langium/src/workspace Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -195,16 +195,20 @@ export class DefaultWorkspaceManager implements WorkspaceManager {
195195 * contained files that match the file extensions are added to the `uris` array.
196196 */
197197 protected async traverseFolder ( folderPath : URI , uris : URI [ ] ) : Promise < void > {
198- const content = await this . fileSystemProvider . readDirectory ( folderPath ) ;
199- await Promise . all ( content . map ( async entry => {
200- if ( this . shouldIncludeEntry ( entry ) ) {
201- if ( entry . isDirectory ) {
202- await this . traverseFolder ( entry . uri , uris ) ;
203- } else if ( entry . isFile ) {
204- uris . push ( entry . uri ) ;
198+ try {
199+ const content = await this . fileSystemProvider . readDirectory ( folderPath ) ;
200+ await Promise . all ( content . map ( async entry => {
201+ if ( this . shouldIncludeEntry ( entry ) ) {
202+ if ( entry . isDirectory ) {
203+ await this . traverseFolder ( entry . uri , uris ) ;
204+ } else if ( entry . isFile ) {
205+ uris . push ( entry . uri ) ;
206+ }
205207 }
206- }
207- } ) ) ;
208+ } ) ) ;
209+ } catch ( e ) {
210+ console . error ( 'Failure to read directory content of ' + folderPath . toString ( true ) , e ) ;
211+ }
208212 }
209213
210214 async searchFolder ( uri : URI ) : Promise < URI [ ] > {
You can’t perform that action at this time.
0 commit comments