提交 8efcb4e9 编写于 作者: D Dirk Baeumer

Fixes #30044: Task contribution should allow extension to supress problem matcher attach message

上级 b92a9b09
......@@ -123,7 +123,7 @@ async function getNpmScriptsAsTasks(): Promise<vscode.Task[]> {
result.push(task);
});
// add some 'well known' npm tasks
result.push(new vscode.Task({ type: 'npm', script: 'install' } as NpmTaskDefinition, `install`, 'npm', new vscode.ShellExecution(`npm install`)));
result.push(new vscode.Task({ type: 'npm', script: 'install' } as NpmTaskDefinition, `install`, 'npm', new vscode.ShellExecution(`npm install`), []));
return Promise.resolve(result);
} catch (e) {
return Promise.resolve(emptyTasks);
......
......@@ -352,7 +352,8 @@ namespace Tasks {
group: task.group ? (task.group as types.TaskGroup).id : undefined,
command: command,
isBackground: !!task.isBackground,
problemMatchers: task.problemMatchers.slice()
problemMatchers: task.problemMatchers.slice(),
hasDefinedMatchers: (task as types.Task).hasDefinedMatchers
};
return result;
}
......
......@@ -1158,6 +1158,7 @@ export class Task implements vscode.Task {
private _name: string;
private _execution: ProcessExecution | ShellExecution;
private _problemMatchers: string[];
private _hasDefinedMatchers: boolean;
private _isBackground: boolean;
private _source: string;
private _group: TaskGroup;
......@@ -1170,10 +1171,13 @@ export class Task implements vscode.Task {
this.execution = execution;
if (typeof problemMatchers === 'string') {
this._problemMatchers = [problemMatchers];
this._hasDefinedMatchers = true;
} else if (Array.isArray(problemMatchers)) {
this._problemMatchers = problemMatchers;
this._hasDefinedMatchers = true;
} else {
this._problemMatchers = [];
this._hasDefinedMatchers = false;
}
this._isBackground = false;
}
......@@ -1227,9 +1231,16 @@ export class Task implements vscode.Task {
set problemMatchers(value: string[]) {
if (!Array.isArray(value)) {
value = [];
this._problemMatchers = [];
this._hasDefinedMatchers = false;
return;
}
this._problemMatchers = value;
this._hasDefinedMatchers = true;
}
get hasDefinedMatchers(): boolean {
return this._hasDefinedMatchers;
}
get isBackground(): boolean {
......
......@@ -340,6 +340,8 @@ export interface ContributedTask extends CommonTask, ConfigurationProperties {
defines: TaskIdentifier;
hasDefinedMatchers: boolean;
/**
* The command configuration
*/
......
......@@ -856,7 +856,7 @@ class TaskService extends EventEmitter implements ITaskService {
return false;
}
if (task._source.config === void 0 && ContributedTask.is(task)) {
return true;
return !task.hasDefinedMatchers && task.problemMatchers.length === 0;
}
let configProperties: TaskConfig.ConfigurationProperties = task._source.config.element;
return configProperties.problemMatcher === void 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册