File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -291,11 +291,17 @@ export class NpmScriptsTreeDataProvider implements TreeDataProvider<TreeItem> {
291291 let folder = null ;
292292 let packageJson = null ;
293293
294- const regularExpressionsSetting = workspace . getConfiguration ( 'npm' ) . get < string [ ] > ( 'scriptExplorerExclude' , [ ] ) ;
295- const regularExpressions = regularExpressionsSetting ?. map ( value => RegExp ( value ) ) ;
294+ const excludeConfig : Map < string , RegExp [ ] > = new Map ( ) ;
296295
297296 tasks . forEach ( each => {
298- if ( regularExpressions . some ( ( regularExpression ) => ( < NpmTaskDefinition > each . task . definition ) . script . match ( regularExpression ) ) ) {
297+ const location = each . location ;
298+ if ( location && ! excludeConfig . has ( location . uri . toString ( ) ) ) {
299+ const regularExpressionsSetting = workspace . getConfiguration ( 'npm' , location . uri ) . get < string [ ] > ( 'scriptExplorerExclude' , [ ] ) ;
300+ excludeConfig . set ( location . uri . toString ( ) , regularExpressionsSetting ?. map ( value => RegExp ( value ) ) ) ;
301+ }
302+ const regularExpressions = ( location && excludeConfig . has ( location . uri . toString ( ) ) ) ? excludeConfig . get ( location . uri . toString ( ) ) : undefined ;
303+
304+ if ( regularExpressions && regularExpressions . some ( ( regularExpression ) => ( < NpmTaskDefinition > each . task . definition ) . script . match ( regularExpression ) ) ) {
299305 return ;
300306 }
301307
You can’t perform that action at this time.
0 commit comments