提交 ef7aa9f2 编写于 作者: A Alex Ross

Rename task presenation clearBeforeExecuting to clear

上级 f8b40686
......@@ -1182,7 +1182,7 @@ declare module 'vscode' {
/**
* Controls whether the terminal is cleared before executing the task.
*/
clearBeforeExecuting?: boolean;
clear?: boolean;
}
//#endregion
......
......@@ -91,7 +91,7 @@ namespace TaskPresentationOptionsDTO {
}
export function to(value: TaskPresentationOptionsDTO): PresentationOptions {
if (value === void 0 || value === null) {
return { reveal: RevealKind.Always, echo: true, focus: false, panel: PanelKind.Shared, showReuseMessage: true, clearBeforeExecuting: false };
return { reveal: RevealKind.Always, echo: true, focus: false, panel: PanelKind.Shared, showReuseMessage: true, clear: false };
}
return Objects.assign(Object.create(null), value);
}
......
......@@ -231,7 +231,7 @@ namespace TaskPanelKind {
namespace PresentationOptions {
export function from(value: vscode.TaskPresentationOptions): tasks.PresentationOptions {
if (value === void 0 || value === null) {
return { reveal: tasks.RevealKind.Always, echo: true, focus: false, panel: tasks.PanelKind.Shared, showReuseMessage: true, clearBeforeExecuting: false };
return { reveal: tasks.RevealKind.Always, echo: true, focus: false, panel: tasks.PanelKind.Shared, showReuseMessage: true, clear: false };
}
return {
reveal: TaskRevealKind.from(value.reveal),
......@@ -239,7 +239,7 @@ namespace PresentationOptions {
focus: !!value.focus,
panel: TaskPanelKind.from(value.panel),
showReuseMessage: value.showReuseMessage === void 0 ? true : !!value.showReuseMessage,
clearBeforeExecuting: value.clearBeforeExecuting === void 0 ? false : !!value.clearBeforeExecuting,
clear: value.clear === void 0 ? false : !!value.clear,
};
}
}
......
......@@ -16,7 +16,7 @@ export interface TaskPresentationOptionsDTO {
focus?: boolean;
panel?: number;
showReuseMessage?: boolean;
clearBeforeExecuting?: boolean;
clear?: boolean;
}
export interface ExecutionOptionsDTO {
......
......@@ -207,7 +207,7 @@ export interface PresentationOptions {
/**
* Controls whether to clear the terminal before executing the task.
*/
clearBeforeExecuting: boolean;
clear: boolean;
}
export enum RuntimeType {
......
......@@ -83,7 +83,7 @@ const presentation: IJSONSchema = {
focus: false,
panel: 'shared',
showReuseMessage: true,
clearBeforeExecuting: false,
clear: false,
},
description: nls.localize('JsonSchema.tasks.presentation', 'Configures the panel that is used to present the task\'s ouput and reads its input.'),
additionalProperties: false,
......@@ -120,10 +120,10 @@ const presentation: IJSONSchema = {
default: true,
description: nls.localize('JsonSchema.tasks.presentation.showReuseMessage', 'Controls whether to show the `Terminal will be reused by tasks, press any key to close it` message.')
},
clearBeforeExecuting: {
clear: {
type: 'boolean',
default: false,
description: nls.localize('JsonSchema.tasks.presentation.clearBeforeExecuting', 'Controls whether the terminal is cleared before executing the task.')
description: nls.localize('JsonSchema.tasks.presentation.clear', 'Controls whether the terminal is cleared before executing the task.')
}
}
};
......
......@@ -683,7 +683,7 @@ export class TerminalTaskSystem implements ITaskSystem {
}
if (terminalToReuse) {
terminalToReuse.terminal.reuseTerminal(shellLaunchConfig);
if (task.command.presentation.clearBeforeExecuting) {
if (task.command.presentation.clear) {
terminalToReuse.terminal.clear();
}
return [terminalToReuse.terminal, commandExecutable, undefined];
......
......@@ -116,7 +116,7 @@ export interface PresentationOptions {
/**
* Controls whether the terminal should be cleared before running the task.
*/
clearBeforeExecuting?: boolean;
clear?: boolean;
}
export interface TaskIdentifier {
......@@ -759,7 +759,7 @@ namespace CommandConfiguration {
let focus: boolean;
let panel: Tasks.PanelKind;
let showReuseMessage: boolean;
let clearBeforeExecuting: boolean;
let clear: boolean;
if (Types.isBoolean(config.echoCommand)) {
echo = config.echoCommand;
}
......@@ -783,14 +783,14 @@ namespace CommandConfiguration {
if (Types.isBoolean(presentation.showReuseMessage)) {
showReuseMessage = presentation.showReuseMessage;
}
if (Types.isBoolean(presentation.clearBeforeExecuting)) {
clearBeforeExecuting = presentation.clearBeforeExecuting;
if (Types.isBoolean(presentation.clear)) {
clear = presentation.clear;
}
}
if (echo === void 0 && reveal === void 0 && focus === void 0 && panel === void 0 && showReuseMessage === void 0) {
return undefined;
}
return { echo, reveal, focus, panel, showReuseMessage, clearBeforeExecuting };
return { echo, reveal, focus, panel, showReuseMessage, clear };
}
export function assignProperties(target: Tasks.PresentationOptions, source: Tasks.PresentationOptions): Tasks.PresentationOptions {
......@@ -803,7 +803,7 @@ namespace CommandConfiguration {
export function fillDefaults(value: Tasks.PresentationOptions, context: ParseContext): Tasks.PresentationOptions {
let defaultEcho = context.engine === Tasks.ExecutionEngine.Terminal ? true : false;
return _fillDefaults(value, { echo: defaultEcho, reveal: Tasks.RevealKind.Always, focus: false, panel: Tasks.PanelKind.Shared, showReuseMessage: true, clearBeforeExecuting: false }, properties, context);
return _fillDefaults(value, { echo: defaultEcho, reveal: Tasks.RevealKind.Always, focus: false, panel: Tasks.PanelKind.Shared, showReuseMessage: true, clear: false }, properties, context);
}
export function freeze(value: Tasks.PresentationOptions): Readonly<Tasks.PresentationOptions> {
......
......@@ -83,7 +83,7 @@ class PresentationBuilder {
public result: Tasks.PresentationOptions;
constructor(public parent: CommandConfigurationBuilder) {
this.result = { echo: false, reveal: Tasks.RevealKind.Always, focus: false, panel: Tasks.PanelKind.Shared, showReuseMessage: true, clearBeforeExecuting: false };
this.result = { echo: false, reveal: Tasks.RevealKind.Always, focus: false, panel: Tasks.PanelKind.Shared, showReuseMessage: true, clear: false };
}
public echo(value: boolean): PresentationBuilder {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册