Skip to content

Commit a1fd514

Browse files
committed
Fixes microsoft#27589: Inconsistent use of ProblemMatcher
1 parent 4bb81e3 commit a1fd514

2 files changed

Lines changed: 27 additions & 22 deletions

File tree

src/vs/vscode.d.ts

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3610,11 +3610,6 @@ declare module 'vscode' {
36103610
export const Test: 'test';
36113611
}
36123612

3613-
/**
3614-
* The ProblemMatchers type definition.
3615-
*/
3616-
export type ProblemMatchers = string | string[];
3617-
36183613
/**
36193614
* A task that starts an external process.
36203615
*/
@@ -3625,19 +3620,23 @@ declare module 'vscode' {
36253620
*
36263621
* @param name the task's name. Is presented in the user interface.
36273622
* @param process the process to start.
3628-
* @param problemMatchers the problem matchers to use.
3623+
* @param problemMatchers the names of problem matchers to use, like '$tsc'
3624+
* or '$eslint'. Problem matchers can be contributed by an extension using
3625+
* the `problemMatchers` extension point.
36293626
*/
3630-
constructor(name: string, process: string, problemMatchers?: ProblemMatchers);
3627+
constructor(name: string, process: string, problemMatchers?: string | string[]);
36313628

36323629
/**
36333630
* Creates a process task.
36343631
*
36353632
* @param name the task's name. Is presented in the user interface.
36363633
* @param process the process to start.
36373634
* @param args arguments to be passed to the process.
3638-
* @param problemMatchers the problem matchers to use.
3635+
* @param problemMatchers the names of problem matchers to use, like '$tsc'
3636+
* or '$eslint'. Problem matchers can be contributed by an extension using
3637+
* the `problemMatchers` extension point.
36393638
*/
3640-
constructor(name: string, process: string, args: string[], problemMatchers?: ProblemMatchers);
3639+
constructor(name: string, process: string, args: string[], problemMatchers?: string | string[]);
36413640

36423641
/**
36433642
* Creates a process task.
@@ -3646,9 +3645,11 @@ declare module 'vscode' {
36463645
* @param process the process to start.
36473646
* @param args arguments to be passed to the process.
36483647
* @param options additional options for the started process.
3649-
* @param problemMatchers the problem matchers to use.
3648+
* @param problemMatchers the names of problem matchers to use, like '$tsc'
3649+
* or '$eslint'. Problem matchers can be contributed by an extension using
3650+
* the `problemMatchers` extension point.
36503651
*/
3651-
constructor(name: string, process: string, args: string[], options: ProcessTaskOptions, problemMatchers?: ProblemMatchers);
3652+
constructor(name: string, process: string, args: string[], options: ProcessTaskOptions, problemMatchers?: string | string[]);
36523653

36533654
/**
36543655
* The task's name
@@ -3769,19 +3770,23 @@ declare module 'vscode' {
37693770
*
37703771
* @param name the task's name. Is presented in the user interface.
37713772
* @param commandLine the command line to execute.
3772-
* @param problemMatchers the problem matchers to use.
3773+
* @param problemMatchers the names of problem matchers to use, like '$tsc'
3774+
* or '$eslint'. Problem matchers can be contributed by an extension using
3775+
* the `problemMatchers` extension point.
37733776
*/
3774-
constructor(name: string, commandLine: string, problemMatchers?: ProblemMatchers);
3777+
constructor(name: string, commandLine: string, problemMatchers?: string | string[]);
37753778

37763779
/**
37773780
* Creates a shell task.
37783781
*
37793782
* @param name the task's name. Is presented in the user interface.
37803783
* @param commandLine the command line to execute.
37813784
* @param options additional options used when creating the shell.
3782-
* @param problemMatchers the problem matchers to use.
3785+
* @param problemMatchers the names of problem matchers to use, like '$tsc'
3786+
* or '$eslint'. Problem matchers can be contributed by an extension using
3787+
* the `problemMatchers` extension point.
37833788
*/
3784-
constructor(name: string, commandLine: string, options: ShellTaskOptions, problemMatchers?: ProblemMatchers);
3789+
constructor(name: string, commandLine: string, options: ShellTaskOptions, problemMatchers?: string | string[]);
37853790

37863791
/**
37873792
* The task's name

src/vs/workbench/api/node/extHostTypes.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,15 +1186,15 @@ export class ProcessTask extends BaseTask {
11861186
private _args: string[];
11871187
private _options: vscode.ProcessTaskOptions;
11881188

1189-
constructor(name: string, process: string, args?: string[], problemMatchers?: vscode.ProblemMatchers);
1190-
constructor(name: string, process: string, args: string[] | undefined, options: vscode.ProcessTaskOptions, problemMatchers?: vscode.ProblemMatchers);
1191-
constructor(name: string, process: string, arg3?: string[], arg4?: vscode.ProcessTaskOptions | vscode.ProblemMatchers, arg5?: vscode.ProblemMatchers) {
1189+
constructor(name: string, process: string, args?: string[], problemMatchers?: string | string[]);
1190+
constructor(name: string, process: string, args: string[] | undefined, options: vscode.ProcessTaskOptions, problemMatchers?: string | string[]);
1191+
constructor(name: string, process: string, arg3?: string[], arg4?: vscode.ProcessTaskOptions | string | string[], arg5?: string | string[]) {
11921192
if (typeof process !== 'string') {
11931193
throw illegalArgument('process');
11941194
}
11951195
let args: string[];
11961196
let options: vscode.ProcessTaskOptions;
1197-
let problemMatchers: vscode.ProblemMatchers;
1197+
let problemMatchers: string | string[];
11981198

11991199
args = arg3 || [];
12001200
if (arg4) {
@@ -1252,9 +1252,9 @@ export class ShellTask extends BaseTask implements vscode.ShellTask {
12521252
private _commandLine: string;
12531253
private _options: vscode.ShellTaskOptions;
12541254

1255-
constructor(name: string, commandLine: string, problemMatchers?: vscode.ProblemMatchers);
1256-
constructor(name: string, commandLine: string, options: vscode.ShellTaskOptions, problemMatchers?: vscode.ProblemMatchers);
1257-
constructor(name: string, commandLine: string, optionsOrProblemMatchers?: vscode.ShellTaskOptions | vscode.ProblemMatchers, problemMatchers?: vscode.ProblemMatchers) {
1255+
constructor(name: string, commandLine: string, problemMatchers?: string | string[]);
1256+
constructor(name: string, commandLine: string, options: vscode.ShellTaskOptions, problemMatchers?: string | string[]);
1257+
constructor(name: string, commandLine: string, optionsOrProblemMatchers?: vscode.ShellTaskOptions | string | string[], problemMatchers?: string | string[]) {
12581258
if (typeof commandLine !== 'string') {
12591259
throw illegalArgument('commandLine');
12601260
}

0 commit comments

Comments
 (0)