mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 03:29:00 +01:00
Remove ProblemMatchers from API.
This commit is contained in:
@@ -536,8 +536,6 @@ export function createApiFactory(
|
||||
TreeItemCollapsibleState: extHostTypes.TreeItemCollapsibleState,
|
||||
ThemeColor: extHostTypes.ThemeColor,
|
||||
// functions
|
||||
FileLocationKind: extHostTypes.FileLocationKind,
|
||||
ApplyToKind: extHostTypes.ApplyToKind,
|
||||
RevealKind: extHostTypes.RevealKind,
|
||||
TaskGroup: extHostTypes.TaskGroup,
|
||||
ShellTask: extHostTypes.ShellTask,
|
||||
|
||||
@@ -8,13 +8,11 @@ import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import * as UUID from 'vs/base/common/uuid';
|
||||
import { asWinJsPromise } from 'vs/base/common/async';
|
||||
|
||||
import * as Problems from 'vs/platform/markers/common/problemMatcher';
|
||||
import { IExtensionDescription } from 'vs/platform/extensions/common/extensions';
|
||||
import * as TaskSystem from 'vs/workbench/parts/tasks/common/tasks';
|
||||
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
import { MainContext, MainThreadTaskShape, ExtHostTaskShape } from 'vs/workbench/api/node/extHost.protocol';
|
||||
import { fromDiagnosticSeverity } from 'vs/workbench/api/node/extHostTypeConverters';
|
||||
|
||||
import * as types from 'vs/workbench/api/node/extHostTypes';
|
||||
import * as vscode from 'vscode';
|
||||
@@ -23,6 +21,7 @@ interface StringMap<V> {
|
||||
[key: string]: V;
|
||||
}
|
||||
|
||||
/*
|
||||
namespace ProblemPattern {
|
||||
export function from(value: vscode.ProblemPattern | vscode.MultiLineProblemPattern): Problems.ProblemPattern | Problems.MultiLineProblemPattern {
|
||||
if (value === void 0 || value === null) {
|
||||
@@ -144,7 +143,7 @@ namespace WatchingPattern {
|
||||
}
|
||||
}
|
||||
|
||||
namespace WathingMatcher {
|
||||
namespace BackgroundMonitor {
|
||||
export function from(value: vscode.BackgroundMonitor): Problems.WatchingMatcher {
|
||||
if (value === void 0 || value === null) {
|
||||
return undefined;
|
||||
@@ -190,6 +189,7 @@ namespace ProblemMatcher {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
namespace RevealKind {
|
||||
export function from(value: vscode.RevealKind): TaskSystem.ShowOutput {
|
||||
@@ -314,7 +314,7 @@ namespace Tasks {
|
||||
showOutput: behaviour.showOutput,
|
||||
isBackground: !!task.isBackground,
|
||||
suppressTaskName: true,
|
||||
problemMatchers: ProblemMatcher.from(task.problemMatchers)
|
||||
problemMatchers: task.problemMatchers.slice()
|
||||
};
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1018,12 +1018,12 @@ export enum RevealKind {
|
||||
export class BaseTask {
|
||||
|
||||
private _name: string;
|
||||
private _problemMatchers: (string | vscode.ProblemMatcher)[];
|
||||
private _problemMatchers: string[];
|
||||
private _identifier: string;
|
||||
private _isBackground: boolean;
|
||||
private _terminal: vscode.TerminalBehaviour;
|
||||
|
||||
constructor(name: string, problemMatchers: (string | vscode.ProblemMatcher)[]) {
|
||||
constructor(name: string, problemMatchers: string[]) {
|
||||
if (typeof name !== 'string') {
|
||||
throw illegalArgument('name');
|
||||
}
|
||||
@@ -1074,11 +1074,11 @@ export class BaseTask {
|
||||
this._terminal = value;
|
||||
}
|
||||
|
||||
get problemMatchers(): (string | vscode.ProblemMatcher)[] {
|
||||
get problemMatchers(): string[] {
|
||||
return this._problemMatchers;
|
||||
}
|
||||
|
||||
set problemMatchers(value: (string | vscode.ProblemMatcher)[]) {
|
||||
set problemMatchers(value: string[]) {
|
||||
if (!Array.isArray(value)) {
|
||||
value = [];
|
||||
}
|
||||
@@ -1086,12 +1086,14 @@ export class BaseTask {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
namespace ProblemMatcher {
|
||||
export function is(value: any): value is vscode.ProblemMatcher {
|
||||
let candidate: vscode.ProblemMatcher = value;
|
||||
return candidate && !!candidate.pattern;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
namespace ShellOptions {
|
||||
export function is(value: any): value is vscode.ShellOptions {
|
||||
@@ -1144,7 +1146,7 @@ export class ProcessTask extends BaseTask {
|
||||
|
||||
args = arg3 || [];
|
||||
if (arg4) {
|
||||
if (Array.isArray(arg4) || typeof arg4 === 'string' || ProblemMatcher.is(arg4)) {
|
||||
if (Array.isArray(arg4) || typeof arg4 === 'string') {
|
||||
problemMatchers = arg4;
|
||||
} else {
|
||||
options = arg4;
|
||||
@@ -1153,8 +1155,8 @@ export class ProcessTask extends BaseTask {
|
||||
if (arg5 && !problemMatchers) {
|
||||
problemMatchers = arg5;
|
||||
}
|
||||
let pm: (string | vscode.ProblemMatcher)[];
|
||||
if (problemMatchers && (typeof problemMatchers === 'string' || ProblemMatcher.is(problemMatchers))) {
|
||||
let pm: string[];
|
||||
if (problemMatchers && (typeof problemMatchers === 'string')) {
|
||||
pm = [problemMatchers];
|
||||
} else if (Array.isArray(problemMatchers)) {
|
||||
pm = problemMatchers;
|
||||
@@ -1217,13 +1219,13 @@ export class ShellTask extends BaseTask implements vscode.ShellTask {
|
||||
throw illegalArgument('commandLine');
|
||||
}
|
||||
let options: vscode.ShellOptions = undefined;
|
||||
let pm: (string | vscode.ProblemMatcher)[];
|
||||
let pm: string[];
|
||||
if (ShellOptions.is(optionsOrProblemMatchers)) {
|
||||
options = optionsOrProblemMatchers;
|
||||
} else {
|
||||
problemMatchers = optionsOrProblemMatchers;
|
||||
}
|
||||
if (problemMatchers && (typeof problemMatchers === 'string' || ProblemMatcher.is(problemMatchers))) {
|
||||
if (problemMatchers && (typeof problemMatchers === 'string')) {
|
||||
pm = [problemMatchers];
|
||||
} else if (Array.isArray(problemMatchers)) {
|
||||
pm = problemMatchers;
|
||||
|
||||
Reference in New Issue
Block a user