提交 46843c36 编写于 作者: D Dirk Baeumer

Only offer task problem matcher attach in V2

上级 6b00b9f0
......@@ -27,7 +27,7 @@ class TaskEntry extends base.TaskEntry {
return false;
}
let task = this._task;
if (task.problemMatchers === void 0 || task.problemMatchers.length === 0) {
if (this.taskService.canCustomize() && task.problemMatchers === void 0 || task.problemMatchers.length === 0) {
this.attachProblemMatcher(task).then((task) => {
this.doRun(task);
});
......
......@@ -27,7 +27,7 @@ class TaskEntry extends base.TaskEntry {
return false;
}
let task = this._task;
if (task.group === TaskGroup.Build && ((task.problemMatchers === void 0) || task.problemMatchers.length === 0)) {
if (this.taskService.canCustomize() && task.group === TaskGroup.Build && ((task.problemMatchers === void 0) || task.problemMatchers.length === 0)) {
this.attachProblemMatcher(task).then(task => this.doRun(task));
return true;
} else {
......
......@@ -45,6 +45,7 @@ export interface ITaskService extends IEventEmitter {
getTasksForGroup(group: string): TPromise<Task[]>;
getRecentlyUsedTasks(): LinkedMap<string, string>;
canCustomize(): boolean;
customize(task: Task, properties?: { problemMatcher: string | string[] }, openConfig?: boolean): TPromise<void>;
registerTaskProvider(handle: number, taskProvider: ITaskProvider): void;
......
......@@ -816,6 +816,10 @@ class TaskService extends EventEmitter implements ITaskService {
});
}
public canCustomize(): boolean {
return this.getJsonSchemaVersion() === JsonSchemaVersion.V2_0_0;
}
public customize(task: Task, properties?: { problemMatcher: string | string[] }, openConfig?: boolean): TPromise<void> {
if (!ContributedTask.is(task)) {
return TPromise.as<void>(undefined);
......
......@@ -428,8 +428,9 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem {
let shellArgs = <string[]>shellLaunchConfig.args.slice(0);
let toAdd: string[] = [];
let commandLine = args && args.length > 0 ? `${command} ${args.join(' ')}` : `${command}`;
let basename: string;
if (Platform.isWindows) {
let basename = path.basename(shellLaunchConfig.executable).toLowerCase();
basename = path.basename(shellLaunchConfig.executable).toLowerCase();
if (basename === 'powershell.exe') {
if (!shellSpecified) {
toAdd.push('-Command');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册