mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
remove filterPrePostScripts
This commit is contained in:
parent
686498e198
commit
6b129c5558
|
@ -15,4 +15,3 @@ For more information about auto detection of Tasks pls see the [documentation](h
|
|||
- `npm.packageManager` the package manager used to run the scripts: `npm` or `yarn`, the default is `npm`.
|
||||
- `npm.exclude` glob patterns for folders that should be excluded from automatic script detection. The pattern is matched against the **absolute path** of the package.json. For example, to exclude all test folders use '**/test/**'.
|
||||
- `npm.enableScriptExplorer` enable an explorer view for npm scripts.
|
||||
- `npm.filterPrePostScripts` filter pre or post scripts, the default is `true`.
|
||||
|
|
|
@ -151,12 +151,6 @@
|
|||
"default": false,
|
||||
"scope": "resource",
|
||||
"description": "%config.npm.enableScriptExplorer%"
|
||||
},
|
||||
"npm.filterPrePostScripts": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"scope": "resource",
|
||||
"description": "%config.npm.filterPrePostScripts%"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
"config.npm.packageManager": "The package manager used to run scripts.",
|
||||
"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.",
|
||||
"config.npm.filterPrePostScripts": "Filter pre- and postscripts. Default is true.",
|
||||
"npm.parseError": "Npm task detection: failed to parse the file {0}",
|
||||
"taskdef.script": "The npm script to customize.",
|
||||
"taskdef.path": "The path to the folder of the package.json file that provides the script. Can be omitted.",
|
||||
|
|
|
@ -15,16 +15,10 @@ let taskProvider: vscode.Disposable | undefined;
|
|||
|
||||
export async function activate(context: vscode.ExtensionContext): Promise<void> {
|
||||
taskProvider = registerTaskProvider(context);
|
||||
let treeDataProvider = registerExplorer(context);
|
||||
registerExplorer(context);
|
||||
configureHttpRequest();
|
||||
vscode.workspace.onDidChangeConfiguration((e) => {
|
||||
vscode.workspace.onDidChangeConfiguration(() => {
|
||||
configureHttpRequest();
|
||||
if (e.affectsConfiguration('npm.filterPrePostScripts')) {
|
||||
invalidateScriptsCache();
|
||||
if (treeDataProvider) {
|
||||
treeDataProvider.refresh();
|
||||
}
|
||||
}
|
||||
});
|
||||
context.subscriptions.push(addJSONProviders(httpRequest.xhr));
|
||||
}
|
||||
|
|
|
@ -171,9 +171,8 @@ async function provideNpmScriptsForFolder(packageJsonUri: Uri): Promise<Task[]>
|
|||
|
||||
const result: Task[] = [];
|
||||
|
||||
const filterPrePost = workspace.getConfiguration('npm', folder.uri).get<boolean>('filterPrePostScripts');
|
||||
const prePostScripts = filterPrePost ? getPrePostScripts(scripts) : new Set<String>();
|
||||
Object.keys(scripts).filter(each => !prePostScripts.has(each)).forEach(each => {
|
||||
const prePostScripts = getPrePostScripts(scripts);
|
||||
Object.keys(scripts).forEach(each => {
|
||||
const task = createTask(each, `run ${each}`, folder!, packageJsonUri);
|
||||
const lowerCaseTaskName = each.toLowerCase();
|
||||
if (isBuildTask(lowerCaseTaskName)) {
|
||||
|
@ -181,6 +180,9 @@ async function provideNpmScriptsForFolder(packageJsonUri: Uri): Promise<Task[]>
|
|||
} else if (isTestTask(lowerCaseTaskName)) {
|
||||
task.group = TaskGroup.Test;
|
||||
}
|
||||
if (prePostScripts.has(each)) {
|
||||
task.group = TaskGroup.Clean; // hack: use Clean group to tag pre/post scripts
|
||||
}
|
||||
result.push(task);
|
||||
});
|
||||
// always add npm install (without a problem matcher)
|
||||
|
|
Loading…
Reference in a new issue