Skip to content

Commit 6fb0af2

Browse files
committed
Fixes microsoft#27581: Unspecific names: TerminalBehaviour and RevealKind
1 parent 8afd3ff commit 6fb0af2

4 files changed

Lines changed: 44 additions & 42 deletions

File tree

src/vs/vscode.d.ts

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3540,7 +3540,7 @@ declare module 'vscode' {
35403540
/**
35413541
* Controls the behaviour of the terminal's visibility.
35423542
*/
3543-
export enum RevealKind {
3543+
export enum TaskRevealKind {
35443544
/**
35453545
* Always brings the terminal to front if the task is executed.
35463546
*/
@@ -3559,22 +3559,22 @@ declare module 'vscode' {
35593559
}
35603560

35613561
/**
3562-
* Controls terminal specific behaviour.
3562+
* Controls terminal specific behavior.
35633563
*/
3564-
export interface TerminalBehaviour {
3564+
export interface TaskTerminalBehavior {
35653565
/**
35663566
* Controls whether the terminal executing a task is brought to front or not.
35673567
* Defaults to `RevealKind.Always`.
35683568
*/
3569-
reveal?: RevealKind;
3569+
reveal?: TaskRevealKind;
35703570

35713571
/**
35723572
* Controls whether the command is echoed in the terminal or not.
35733573
*/
35743574
echo?: boolean;
35753575
}
35763576

3577-
export interface ProcessOptions {
3577+
export interface ProcessTaskOptions {
35783578
/**
35793579
* The current working directory of the executed program or shell.
35803580
* If omitted the tools current workspace root is used.
@@ -3595,15 +3595,17 @@ declare module 'vscode' {
35953595
*/
35963596
export const Clean: 'clean';
35973597
/**
3598-
* The build task group
3598+
* The build task group. If a task is part of the build task group
3599+
* it can be executed via the run build short cut.
35993600
*/
36003601
export const Build: 'build';
36013602
/**
36023603
* The rebuild all task group
36033604
*/
36043605
export const RebuildAll: 'rebuildAll';
36053606
/**
3606-
* The test task group
3607+
* The test task group. If a task is part of the test task group
3608+
* it can be executed via the run test short cut.
36073609
*/
36083610
export const Test: 'test';
36093611
}
@@ -3646,7 +3648,7 @@ declare module 'vscode' {
36463648
* @param options additional options for the started process.
36473649
* @param problemMatchers the problem matchers to use.
36483650
*/
3649-
constructor(name: string, process: string, args: string[], options: ProcessOptions, problemMatchers?: ProblemMatchers);
3651+
constructor(name: string, process: string, args: string[], options: ProcessTaskOptions, problemMatchers?: ProblemMatchers);
36503652

36513653
/**
36523654
* The task's name
@@ -3692,12 +3694,12 @@ declare module 'vscode' {
36923694
* The process options used when the process is executed.
36933695
* Defaults to an empty object literal.
36943696
*/
3695-
options: ProcessOptions;
3697+
options: ProcessTaskOptions;
36963698

36973699
/**
3698-
* The terminal options. Defaults to an empty object literal.
3700+
* The terminal behavior. Defaults to an empty object literal.
36993701
*/
3700-
terminal: TerminalBehaviour;
3702+
terminal: TaskTerminalBehavior;
37013703

37023704
/**
37033705
* The problem matchers attached to the task. Defaults to an empty
@@ -3706,7 +3708,7 @@ declare module 'vscode' {
37063708
problemMatchers: string[];
37073709
}
37083710

3709-
export type ShellOptions = {
3711+
export type ShellTaskOptions = {
37103712
/**
37113713
* The shell executable.
37123714
*/
@@ -3779,7 +3781,7 @@ declare module 'vscode' {
37793781
* @param options additional options used when creating the shell.
37803782
* @param problemMatchers the problem matchers to use.
37813783
*/
3782-
constructor(name: string, commandLine: string, options: ShellOptions, problemMatchers?: ProblemMatchers);
3784+
constructor(name: string, commandLine: string, options: ShellTaskOptions, problemMatchers?: ProblemMatchers);
37833785

37843786
/**
37853787
* The task's name
@@ -3820,12 +3822,12 @@ declare module 'vscode' {
38203822
* The shell options used when the shell is executed. Defaults to an
38213823
* empty object literal.
38223824
*/
3823-
options: ShellOptions;
3825+
options: ShellTaskOptions;
38243826

38253827
/**
3826-
* The terminal options. Defaults to an empty object literal.
3828+
* The terminal behavior. Defaults to an empty object literal.
38273829
*/
3828-
terminal: TerminalBehaviour;
3830+
terminal: TaskTerminalBehavior;
38293831

38303832
/**
38313833
* The problem matchers attached to the task. Defaults to an empty

src/vs/workbench/api/node/extHost.api.impl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ export function createApiFactory(
537537
TreeItemCollapsibleState: extHostTypes.TreeItemCollapsibleState,
538538
ThemeColor: extHostTypes.ThemeColor,
539539
// functions
540-
RevealKind: extHostTypes.RevealKind,
540+
TaskRevealKind: extHostTypes.TaskRevealKind,
541541
TaskGroup: extHostTypes.TaskGroup,
542542
ShellTask: extHostTypes.ShellTask,
543543
ProcessTask: extHostTypes.ProcessTask

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -191,27 +191,27 @@ namespace ProblemMatcher {
191191
}
192192
*/
193193

194-
namespace RevealKind {
195-
export function from(value: vscode.RevealKind): TaskSystem.RevealKind {
194+
namespace TaskRevealKind {
195+
export function from(value: vscode.TaskRevealKind): TaskSystem.RevealKind {
196196
if (value === void 0 || value === null) {
197197
return TaskSystem.RevealKind.Always;
198198
}
199199
switch (value) {
200-
case types.RevealKind.Silent:
200+
case types.TaskRevealKind.Silent:
201201
return TaskSystem.RevealKind.Silent;
202-
case types.RevealKind.Never:
202+
case types.TaskRevealKind.Never:
203203
return TaskSystem.RevealKind.Never;
204204
}
205205
return TaskSystem.RevealKind.Always;
206206
}
207207
}
208208

209209
namespace TerminalBehaviour {
210-
export function from(value: vscode.TerminalBehaviour): TaskSystem.TerminalBehavior {
210+
export function from(value: vscode.TaskTerminalBehavior): TaskSystem.TerminalBehavior {
211211
if (value === void 0 || value === null) {
212212
return { reveal: TaskSystem.RevealKind.Always, echo: false };
213213
}
214-
return { reveal: RevealKind.from(value.reveal), echo: !!value.echo };
214+
return { reveal: TaskRevealKind.from(value.reveal), echo: !!value.echo };
215215
}
216216
}
217217

@@ -230,10 +230,10 @@ namespace Strings {
230230
}
231231

232232
namespace CommandOptions {
233-
function isShellOptions(value: any): value is vscode.ShellOptions {
233+
function isShellOptions(value: any): value is vscode.ShellTaskOptions {
234234
return value && typeof value.executable === 'string';
235235
}
236-
export function from(value: vscode.ShellOptions | vscode.ProcessOptions): TaskSystem.CommandOptions {
236+
export function from(value: vscode.ShellTaskOptions | vscode.ProcessTaskOptions): TaskSystem.CommandOptions {
237237
if (value === void 0 || value === null) {
238238
return undefined;
239239
}

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ export enum ApplyToKind {
10291029
ClosedDocuments = 3
10301030
}
10311031

1032-
export enum RevealKind {
1032+
export enum TaskRevealKind {
10331033
Always = 1,
10341034

10351035
Silent = 2,
@@ -1045,7 +1045,7 @@ export class BaseTask {
10451045
private _isBackground: boolean;
10461046
private _source: string;
10471047
private _group: string;
1048-
private _terminal: vscode.TerminalBehaviour;
1048+
private _terminal: vscode.TaskTerminalBehavior;
10491049

10501050
constructor(name: string, problemMatchers: string[]) {
10511051
if (typeof name !== 'string') {
@@ -1116,11 +1116,11 @@ export class BaseTask {
11161116
this._group = value;
11171117
}
11181118

1119-
get terminal(): vscode.TerminalBehaviour {
1119+
get terminal(): vscode.TaskTerminalBehavior {
11201120
return this._terminal;
11211121
}
11221122

1123-
set terminal(value: vscode.TerminalBehaviour) {
1123+
set terminal(value: vscode.TaskTerminalBehavior) {
11241124
if (value === void 0 || value === null) {
11251125
value = Object.create(null);
11261126
}
@@ -1149,7 +1149,7 @@ namespace ProblemMatcher {
11491149
*/
11501150

11511151
namespace ShellOptions {
1152-
export function is(value: any): value is vscode.ShellOptions {
1152+
export function is(value: any): value is vscode.ShellTaskOptions {
11531153
return value && ((typeof value.executable === 'string') || (typeof value.cwd === 'string') || !!value.env);
11541154
}
11551155
}
@@ -1184,16 +1184,16 @@ export class ProcessTask extends BaseTask {
11841184

11851185
private _process: string;
11861186
private _args: string[];
1187-
private _options: vscode.ProcessOptions;
1187+
private _options: vscode.ProcessTaskOptions;
11881188

11891189
constructor(name: string, process: string, args?: string[], problemMatchers?: vscode.ProblemMatchers);
1190-
constructor(name: string, process: string, args: string[] | undefined, options: vscode.ProcessOptions, problemMatchers?: vscode.ProblemMatchers);
1191-
constructor(name: string, process: string, arg3?: string[], arg4?: vscode.ProcessOptions | vscode.ProblemMatchers, arg5?: 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) {
11921192
if (typeof process !== 'string') {
11931193
throw illegalArgument('process');
11941194
}
11951195
let args: string[];
1196-
let options: vscode.ProcessOptions;
1196+
let options: vscode.ProcessTaskOptions;
11971197
let problemMatchers: vscode.ProblemMatchers;
11981198

11991199
args = arg3 || [];
@@ -1235,11 +1235,11 @@ export class ProcessTask extends BaseTask {
12351235
this._args = value;
12361236
}
12371237

1238-
get options(): vscode.ProcessOptions {
1238+
get options(): vscode.ProcessTaskOptions {
12391239
return this._options;
12401240
}
12411241

1242-
set options(value: vscode.ProcessOptions) {
1242+
set options(value: vscode.ProcessTaskOptions) {
12431243
if (value === void 0 || value === null) {
12441244
value = Object.create(null);
12451245
}
@@ -1250,15 +1250,15 @@ export class ProcessTask extends BaseTask {
12501250
export class ShellTask extends BaseTask implements vscode.ShellTask {
12511251

12521252
private _commandLine: string;
1253-
private _options: vscode.ShellOptions;
1253+
private _options: vscode.ShellTaskOptions;
12541254

12551255
constructor(name: string, commandLine: string, problemMatchers?: vscode.ProblemMatchers);
1256-
constructor(name: string, commandLine: string, options: vscode.ShellOptions, problemMatchers?: vscode.ProblemMatchers);
1257-
constructor(name: string, commandLine: string, optionsOrProblemMatchers?: vscode.ShellOptions | vscode.ProblemMatchers, 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) {
12581258
if (typeof commandLine !== 'string') {
12591259
throw illegalArgument('commandLine');
12601260
}
1261-
let options: vscode.ShellOptions = undefined;
1261+
let options: vscode.ShellTaskOptions = undefined;
12621262
let pm: string[];
12631263
if (ShellOptions.is(optionsOrProblemMatchers)) {
12641264
options = optionsOrProblemMatchers;
@@ -1280,11 +1280,11 @@ export class ShellTask extends BaseTask implements vscode.ShellTask {
12801280
return this._commandLine;
12811281
}
12821282

1283-
get options(): vscode.ShellOptions {
1283+
get options(): vscode.ShellTaskOptions {
12841284
return this._options;
12851285
}
12861286

1287-
set options(value: vscode.ShellOptions) {
1287+
set options(value: vscode.ShellTaskOptions) {
12881288
if (value === void 0 || value === null) {
12891289
value = Object.create(null);
12901290
}

0 commit comments

Comments
 (0)