Fixes #27581: Unspecific names: TerminalBehaviour and RevealKind

This commit is contained in:
Dirk Baeumer
2017-05-30 21:59:20 +02:00
parent 8afd3ffb65
commit 6fb0af28cd
4 changed files with 44 additions and 42 deletions

View File

@@ -537,7 +537,7 @@ export function createApiFactory(
TreeItemCollapsibleState: extHostTypes.TreeItemCollapsibleState,
ThemeColor: extHostTypes.ThemeColor,
// functions
RevealKind: extHostTypes.RevealKind,
TaskRevealKind: extHostTypes.TaskRevealKind,
TaskGroup: extHostTypes.TaskGroup,
ShellTask: extHostTypes.ShellTask,
ProcessTask: extHostTypes.ProcessTask

View File

@@ -191,15 +191,15 @@ namespace ProblemMatcher {
}
*/
namespace RevealKind {
export function from(value: vscode.RevealKind): TaskSystem.RevealKind {
namespace TaskRevealKind {
export function from(value: vscode.TaskRevealKind): TaskSystem.RevealKind {
if (value === void 0 || value === null) {
return TaskSystem.RevealKind.Always;
}
switch (value) {
case types.RevealKind.Silent:
case types.TaskRevealKind.Silent:
return TaskSystem.RevealKind.Silent;
case types.RevealKind.Never:
case types.TaskRevealKind.Never:
return TaskSystem.RevealKind.Never;
}
return TaskSystem.RevealKind.Always;
@@ -207,11 +207,11 @@ namespace RevealKind {
}
namespace TerminalBehaviour {
export function from(value: vscode.TerminalBehaviour): TaskSystem.TerminalBehavior {
export function from(value: vscode.TaskTerminalBehavior): TaskSystem.TerminalBehavior {
if (value === void 0 || value === null) {
return { reveal: TaskSystem.RevealKind.Always, echo: false };
}
return { reveal: RevealKind.from(value.reveal), echo: !!value.echo };
return { reveal: TaskRevealKind.from(value.reveal), echo: !!value.echo };
}
}
@@ -230,10 +230,10 @@ namespace Strings {
}
namespace CommandOptions {
function isShellOptions(value: any): value is vscode.ShellOptions {
function isShellOptions(value: any): value is vscode.ShellTaskOptions {
return value && typeof value.executable === 'string';
}
export function from(value: vscode.ShellOptions | vscode.ProcessOptions): TaskSystem.CommandOptions {
export function from(value: vscode.ShellTaskOptions | vscode.ProcessTaskOptions): TaskSystem.CommandOptions {
if (value === void 0 || value === null) {
return undefined;
}

View File

@@ -1029,7 +1029,7 @@ export enum ApplyToKind {
ClosedDocuments = 3
}
export enum RevealKind {
export enum TaskRevealKind {
Always = 1,
Silent = 2,
@@ -1045,7 +1045,7 @@ export class BaseTask {
private _isBackground: boolean;
private _source: string;
private _group: string;
private _terminal: vscode.TerminalBehaviour;
private _terminal: vscode.TaskTerminalBehavior;
constructor(name: string, problemMatchers: string[]) {
if (typeof name !== 'string') {
@@ -1116,11 +1116,11 @@ export class BaseTask {
this._group = value;
}
get terminal(): vscode.TerminalBehaviour {
get terminal(): vscode.TaskTerminalBehavior {
return this._terminal;
}
set terminal(value: vscode.TerminalBehaviour) {
set terminal(value: vscode.TaskTerminalBehavior) {
if (value === void 0 || value === null) {
value = Object.create(null);
}
@@ -1149,7 +1149,7 @@ namespace ProblemMatcher {
*/
namespace ShellOptions {
export function is(value: any): value is vscode.ShellOptions {
export function is(value: any): value is vscode.ShellTaskOptions {
return value && ((typeof value.executable === 'string') || (typeof value.cwd === 'string') || !!value.env);
}
}
@@ -1184,16 +1184,16 @@ export class ProcessTask extends BaseTask {
private _process: string;
private _args: string[];
private _options: vscode.ProcessOptions;
private _options: vscode.ProcessTaskOptions;
constructor(name: string, process: string, args?: string[], problemMatchers?: vscode.ProblemMatchers);
constructor(name: string, process: string, args: string[] | undefined, options: vscode.ProcessOptions, problemMatchers?: vscode.ProblemMatchers);
constructor(name: string, process: string, arg3?: string[], arg4?: vscode.ProcessOptions | vscode.ProblemMatchers, arg5?: vscode.ProblemMatchers) {
constructor(name: string, process: string, args: string[] | undefined, options: vscode.ProcessTaskOptions, problemMatchers?: vscode.ProblemMatchers);
constructor(name: string, process: string, arg3?: string[], arg4?: vscode.ProcessTaskOptions | vscode.ProblemMatchers, arg5?: vscode.ProblemMatchers) {
if (typeof process !== 'string') {
throw illegalArgument('process');
}
let args: string[];
let options: vscode.ProcessOptions;
let options: vscode.ProcessTaskOptions;
let problemMatchers: vscode.ProblemMatchers;
args = arg3 || [];
@@ -1235,11 +1235,11 @@ export class ProcessTask extends BaseTask {
this._args = value;
}
get options(): vscode.ProcessOptions {
get options(): vscode.ProcessTaskOptions {
return this._options;
}
set options(value: vscode.ProcessOptions) {
set options(value: vscode.ProcessTaskOptions) {
if (value === void 0 || value === null) {
value = Object.create(null);
}
@@ -1250,15 +1250,15 @@ export class ProcessTask extends BaseTask {
export class ShellTask extends BaseTask implements vscode.ShellTask {
private _commandLine: string;
private _options: vscode.ShellOptions;
private _options: vscode.ShellTaskOptions;
constructor(name: string, commandLine: string, problemMatchers?: vscode.ProblemMatchers);
constructor(name: string, commandLine: string, options: vscode.ShellOptions, problemMatchers?: vscode.ProblemMatchers);
constructor(name: string, commandLine: string, optionsOrProblemMatchers?: vscode.ShellOptions | vscode.ProblemMatchers, problemMatchers?: vscode.ProblemMatchers) {
constructor(name: string, commandLine: string, options: vscode.ShellTaskOptions, problemMatchers?: vscode.ProblemMatchers);
constructor(name: string, commandLine: string, optionsOrProblemMatchers?: vscode.ShellTaskOptions | vscode.ProblemMatchers, problemMatchers?: vscode.ProblemMatchers) {
if (typeof commandLine !== 'string') {
throw illegalArgument('commandLine');
}
let options: vscode.ShellOptions = undefined;
let options: vscode.ShellTaskOptions = undefined;
let pm: string[];
if (ShellOptions.is(optionsOrProblemMatchers)) {
options = optionsOrProblemMatchers;
@@ -1280,11 +1280,11 @@ export class ShellTask extends BaseTask implements vscode.ShellTask {
return this._commandLine;
}
get options(): vscode.ShellOptions {
get options(): vscode.ShellTaskOptions {
return this._options;
}
set options(value: vscode.ShellOptions) {
set options(value: vscode.ShellTaskOptions) {
if (value === void 0 || value === null) {
value = Object.create(null);
}