mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
parent
1b2c610ffe
commit
ae3b03a7eb
|
@ -291,11 +291,17 @@ export class NpmScriptsTreeDataProvider implements TreeDataProvider<TreeItem> {
|
|||
let folder = null;
|
||||
let packageJson = null;
|
||||
|
||||
const regularExpressionsSetting = workspace.getConfiguration('npm').get<string[]>('scriptExplorerExclude', []);
|
||||
const regularExpressions = regularExpressionsSetting?.map(value => RegExp(value));
|
||||
const excludeConfig: Map<string, RegExp[]> = new Map();
|
||||
|
||||
tasks.forEach(each => {
|
||||
if (regularExpressions.some((regularExpression) => (<NpmTaskDefinition>each.task.definition).script.match(regularExpression))) {
|
||||
const location = each.location;
|
||||
if (location && !excludeConfig.has(location.uri.toString())) {
|
||||
const regularExpressionsSetting = workspace.getConfiguration('npm', location.uri).get<string[]>('scriptExplorerExclude', []);
|
||||
excludeConfig.set(location.uri.toString(), regularExpressionsSetting?.map(value => RegExp(value)));
|
||||
}
|
||||
const regularExpressions = (location && excludeConfig.has(location.uri.toString())) ? excludeConfig.get(location.uri.toString()) : undefined;
|
||||
|
||||
if (regularExpressions && regularExpressions.some((regularExpression) => (<NpmTaskDefinition>each.task.definition).script.match(regularExpression))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue