mirror of
https://github.com/Microsoft/vscode
synced 2024-10-12 06:17:18 +00:00
parent
ca9042324f
commit
231fe61ab5
|
@ -281,6 +281,15 @@
|
|||
"scope": "window",
|
||||
"default": "open"
|
||||
},
|
||||
"npm.scriptExplorerExclude": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"markdownDescription": "%config.npm.scriptExplorerExclude%",
|
||||
"scope": "resource",
|
||||
"default": []
|
||||
},
|
||||
"npm.fetchOnlinePackageInfo": {
|
||||
"type": "boolean",
|
||||
"description": "%config.npm.fetchOnlinePackageInfo%",
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
"config.npm.exclude": "Configure glob patterns for folders that should be excluded from automatic script detection.",
|
||||
"config.npm.enableScriptExplorer": "Enable an explorer view for npm scripts when there is no top-level 'package.json' file.",
|
||||
"config.npm.scriptExplorerAction": "The default click action used in the npm scripts explorer: `open` or `run`, the default is `open`.",
|
||||
"config.npm.scriptExplorerExclude": "An array of regular expressions that indicate which scripts should be excluded from the NPM Scripts view.",
|
||||
"config.npm.enableRunFromFolder": "Enable running npm scripts contained in a folder from the Explorer context menu.",
|
||||
"config.npm.fetchOnlinePackageInfo": "Fetch data from https://registry.npmjs.org and https://registry.bower.io to provide auto-completion and information on hover features on npm dependencies.",
|
||||
"npm.parseError": "Npm task detection: failed to parse the file {0}",
|
||||
|
|
|
@ -38,7 +38,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
|
|||
treeDataProvider = registerExplorer(context);
|
||||
|
||||
context.subscriptions.push(vscode.workspace.onDidChangeConfiguration((e) => {
|
||||
if (e.affectsConfiguration('npm.exclude') || e.affectsConfiguration('npm.autoDetect')) {
|
||||
if (e.affectsConfiguration('npm.exclude') || e.affectsConfiguration('npm.autoDetect') || e.affectsConfiguration('npm.scriptExplorerExclude')) {
|
||||
invalidateTasksCache();
|
||||
if (treeDataProvider) {
|
||||
treeDataProvider.refresh();
|
||||
|
|
|
@ -291,7 +291,14 @@ 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));
|
||||
|
||||
tasks.forEach(each => {
|
||||
if (regularExpressions.some((regularExpression) => (<NpmTaskDefinition>each.task.definition).script.match(regularExpression))) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isWorkspaceFolder(each.task.scope) && !this.isInstallTask(each.task)) {
|
||||
folder = folders.get(each.task.scope.name);
|
||||
if (!folder) {
|
||||
|
|
Loading…
Reference in a new issue