File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -128,20 +128,19 @@ async function* expandPatternsInternal(context) {
128128 }
129129
130130 function getSupportedFilesGlob ( ) {
131- if ( ! supportedFilesGlob ) {
132- const extensions = context . languages . flatMap (
133- ( lang ) => lang . extensions || [ ] ,
134- ) ;
135- const filenames = context . languages . flatMap (
136- ( lang ) => lang . filenames || [ ] ,
137- ) ;
138- supportedFilesGlob = [
139- ...extensions . map ( ( ext ) => "*" + ( ext [ 0 ] === "." ? ext : "." + ext ) ) ,
140- ...filenames ,
141- ] ;
142- }
131+ supportedFilesGlob ??= [ ...getSupportedFilesGlobWithoutCache ( ) ] ;
143132 return supportedFilesGlob ;
144133 }
134+
135+ function * getSupportedFilesGlobWithoutCache ( ) {
136+ for ( const { extensions = [ ] , filenames = [ ] } of context . languages ) {
137+ yield * filenames ;
138+
139+ for ( const extension of extensions ) {
140+ yield `*${ extension . startsWith ( "." ) ? extension : `.${ extension } ` } ` ;
141+ }
142+ }
143+ }
145144}
146145
147146const errorMessages = {
You can’t perform that action at this time.
0 commit comments