未验证 提交 4cc01043 编写于 作者: A Alex Ross 提交者: GitHub

revealProblem should be revealProblems (#73414)

Fixes #73412
上级 8ef8aa6b
...@@ -100,16 +100,16 @@ const presentation: IJSONSchema = { ...@@ -100,16 +100,16 @@ const presentation: IJSONSchema = {
default: false, default: false,
description: nls.localize('JsonSchema.tasks.presentation.focus', 'Controls whether the panel takes focus. Default is false. If set to true the panel is revealed as well.') description: nls.localize('JsonSchema.tasks.presentation.focus', 'Controls whether the panel takes focus. Default is false. If set to true the panel is revealed as well.')
}, },
revealProblem: { revealProblems: {
type: 'string', type: 'string',
enum: ['always', 'onProblem', 'never'], enum: ['always', 'onProblem', 'never'],
enumDescriptions: [ enumDescriptions: [
nls.localize('JsonSchema.tasks.presentation.revealProblem.always', 'Always reveals the problems panel when this task is executed.'), nls.localize('JsonSchema.tasks.presentation.revealProblems.always', 'Always reveals the problems panel when this task is executed.'),
nls.localize('JsonSchema.tasks.presentation.revealProblem.onProblem', 'Only reveals the problems panel if a problem is found.'), nls.localize('JsonSchema.tasks.presentation.revealProblems.onProblem', 'Only reveals the problems panel if a problem is found.'),
nls.localize('JsonSchema.tasks.presentation.revealProblem.never', 'Never reveals the problems panel when this task is executed.'), nls.localize('JsonSchema.tasks.presentation.revealProblems.never', 'Never reveals the problems panel when this task is executed.'),
], ],
default: 'never', default: 'never',
description: nls.localize('JsonSchema.tasks.presentation.revealProblem', 'Controls whether the problems panel is revealed when running this task or not. Takes precedence over option \"reveal\". Default is \"never\".') description: nls.localize('JsonSchema.tasks.presentation.revealProblems', 'Controls whether the problems panel is revealed when running this task or not. Takes precedence over option \"reveal\". Default is \"never\".')
}, },
reveal: { reveal: {
type: 'string', type: 'string',
...@@ -120,7 +120,7 @@ const presentation: IJSONSchema = { ...@@ -120,7 +120,7 @@ const presentation: IJSONSchema = {
nls.localize('JsonSchema.tasks.presentation.reveal.never', 'Never reveals the terminal when this task is executed.'), nls.localize('JsonSchema.tasks.presentation.reveal.never', 'Never reveals the terminal when this task is executed.'),
], ],
default: 'always', default: 'always',
description: nls.localize('JsonSchema.tasks.presentation.reveals', 'Controls whether the panel running the task is revealed or not. May be overridden by option \"revealProblem\". Default is \"always\".') description: nls.localize('JsonSchema.tasks.presentation.reveal', 'Controls whether the terminal running the task is revealed or not. May be overridden by option \"revealProblems\". Default is \"always\".')
}, },
panel: { panel: {
type: 'string', type: 'string',
......
...@@ -95,7 +95,7 @@ export interface PresentationOptionsConfig { ...@@ -95,7 +95,7 @@ export interface PresentationOptionsConfig {
* Controls whether the problems panel is revealed when running this task or not. * Controls whether the problems panel is revealed when running this task or not.
* Defaults to `RevealKind.Never`. * Defaults to `RevealKind.Never`.
*/ */
revealProblem?: string; revealProblems?: string;
/** /**
* Controls whether the executed command is printed to the output window or terminal as well. * Controls whether the executed command is printed to the output window or terminal as well.
...@@ -802,7 +802,7 @@ namespace CommandOptions { ...@@ -802,7 +802,7 @@ namespace CommandOptions {
namespace CommandConfiguration { namespace CommandConfiguration {
export namespace PresentationOptions { export namespace PresentationOptions {
const properties: MetaData<Tasks.PresentationOptions, void>[] = [{ property: 'echo' }, { property: 'reveal' }, { property: 'revealProblem' }, { property: 'focus' }, { property: 'panel' }, { property: 'showReuseMessage' }, { property: 'clear' }, { property: 'group' }]; const properties: MetaData<Tasks.PresentationOptions, void>[] = [{ property: 'echo' }, { property: 'reveal' }, { property: 'revealProblems' }, { property: 'focus' }, { property: 'panel' }, { property: 'showReuseMessage' }, { property: 'clear' }, { property: 'group' }];
interface PresentationOptionsShape extends LegacyCommandProperties { interface PresentationOptionsShape extends LegacyCommandProperties {
presentation?: PresentationOptionsConfig; presentation?: PresentationOptionsConfig;
...@@ -811,7 +811,7 @@ namespace CommandConfiguration { ...@@ -811,7 +811,7 @@ namespace CommandConfiguration {
export function from(this: void, config: PresentationOptionsShape, context: ParseContext): Tasks.PresentationOptions | undefined { export function from(this: void, config: PresentationOptionsShape, context: ParseContext): Tasks.PresentationOptions | undefined {
let echo: boolean; let echo: boolean;
let reveal: Tasks.RevealKind; let reveal: Tasks.RevealKind;
let revealProblem: Tasks.RevealProblemKind; let revealProblems: Tasks.RevealProblemKind;
let focus: boolean; let focus: boolean;
let panel: Tasks.PanelKind; let panel: Tasks.PanelKind;
let showReuseMessage: boolean; let showReuseMessage: boolean;
...@@ -834,8 +834,8 @@ namespace CommandConfiguration { ...@@ -834,8 +834,8 @@ namespace CommandConfiguration {
if (Types.isString(presentation.reveal)) { if (Types.isString(presentation.reveal)) {
reveal = Tasks.RevealKind.fromString(presentation.reveal); reveal = Tasks.RevealKind.fromString(presentation.reveal);
} }
if (Types.isString(presentation.revealProblem)) { if (Types.isString(presentation.revealProblems)) {
revealProblem = Tasks.RevealProblemKind.fromString(presentation.revealProblem); revealProblems = Tasks.RevealProblemKind.fromString(presentation.revealProblems);
} }
if (Types.isBoolean(presentation.focus)) { if (Types.isBoolean(presentation.focus)) {
focus = presentation.focus; focus = presentation.focus;
...@@ -857,7 +857,7 @@ namespace CommandConfiguration { ...@@ -857,7 +857,7 @@ namespace CommandConfiguration {
if (!hasProps) { if (!hasProps) {
return undefined; return undefined;
} }
return { echo: echo!, reveal: reveal!, revealProblem: revealProblem!, focus: focus!, panel: panel!, showReuseMessage: showReuseMessage!, clear: clear!, group }; return { echo: echo!, reveal: reveal!, revealProblems: revealProblems!, focus: focus!, panel: panel!, showReuseMessage: showReuseMessage!, clear: clear!, group };
} }
export function assignProperties(target: Tasks.PresentationOptions, source: Tasks.PresentationOptions | undefined): Tasks.PresentationOptions | undefined { export function assignProperties(target: Tasks.PresentationOptions, source: Tasks.PresentationOptions | undefined): Tasks.PresentationOptions | undefined {
...@@ -870,7 +870,7 @@ namespace CommandConfiguration { ...@@ -870,7 +870,7 @@ namespace CommandConfiguration {
export function fillDefaults(value: Tasks.PresentationOptions, context: ParseContext): Tasks.PresentationOptions | undefined { export function fillDefaults(value: Tasks.PresentationOptions, context: ParseContext): Tasks.PresentationOptions | undefined {
let defaultEcho = context.engine === Tasks.ExecutionEngine.Terminal ? true : false; let defaultEcho = context.engine === Tasks.ExecutionEngine.Terminal ? true : false;
return _fillDefaults(value, { echo: defaultEcho, reveal: Tasks.RevealKind.Always, revealProblem: Tasks.RevealProblemKind.Never, focus: false, panel: Tasks.PanelKind.Shared, showReuseMessage: true, clear: false }, properties, context); return _fillDefaults(value, { echo: defaultEcho, reveal: Tasks.RevealKind.Always, revealProblems: Tasks.RevealProblemKind.Never, focus: false, panel: Tasks.PanelKind.Shared, showReuseMessage: true, clear: false }, properties, context);
} }
export function freeze(value: Tasks.PresentationOptions): Readonly<Tasks.PresentationOptions> | undefined { export function freeze(value: Tasks.PresentationOptions): Readonly<Tasks.PresentationOptions> | undefined {
......
...@@ -228,7 +228,7 @@ export interface PresentationOptions { ...@@ -228,7 +228,7 @@ export interface PresentationOptions {
* Controls whether the problems pane is revealed when running this task or not. * Controls whether the problems pane is revealed when running this task or not.
* Defaults to `RevealProblemKind.Never`. * Defaults to `RevealProblemKind.Never`.
*/ */
revealProblem: RevealProblemKind; revealProblems: RevealProblemKind;
/** /**
* Controls whether the command associated with the task is echoed * Controls whether the command associated with the task is echoed
...@@ -266,7 +266,7 @@ export interface PresentationOptions { ...@@ -266,7 +266,7 @@ export interface PresentationOptions {
export namespace PresentationOptions { export namespace PresentationOptions {
export const defaults: PresentationOptions = { export const defaults: PresentationOptions = {
echo: true, reveal: RevealKind.Always, revealProblem: RevealProblemKind.Never, focus: false, panel: PanelKind.Shared, showReuseMessage: true, clear: false echo: true, reveal: RevealKind.Always, revealProblems: RevealProblemKind.Never, focus: false, panel: PanelKind.Shared, showReuseMessage: true, clear: false
}; };
} }
......
...@@ -523,8 +523,8 @@ export class TerminalTaskSystem implements ITaskSystem { ...@@ -523,8 +523,8 @@ export class TerminalTaskSystem implements ITaskSystem {
if ((watchingProblemMatcher.numberOfMatches > 0) && watchingProblemMatcher.maxMarkerSeverity && if ((watchingProblemMatcher.numberOfMatches > 0) && watchingProblemMatcher.maxMarkerSeverity &&
(watchingProblemMatcher.maxMarkerSeverity >= MarkerSeverity.Error)) { (watchingProblemMatcher.maxMarkerSeverity >= MarkerSeverity.Error)) {
let reveal = task.command.presentation!.reveal; let reveal = task.command.presentation!.reveal;
let revealProblem = task.command.presentation!.revealProblem; let revealProblems = task.command.presentation!.revealProblems;
if (revealProblem === RevealProblemKind.OnProblem) { if (revealProblems === RevealProblemKind.OnProblem) {
this.panelService.openPanel(Constants.MARKERS_PANEL_ID, true); this.panelService.openPanel(Constants.MARKERS_PANEL_ID, true);
} else if (reveal === RevealKind.Silent) { } else if (reveal === RevealKind.Silent) {
this.terminalService.setActiveInstance(terminal!); this.terminalService.setActiveInstance(terminal!);
...@@ -653,8 +653,8 @@ export class TerminalTaskSystem implements ITaskSystem { ...@@ -653,8 +653,8 @@ export class TerminalTaskSystem implements ITaskSystem {
} }
} }
let reveal = task.command.presentation!.reveal; let reveal = task.command.presentation!.reveal;
let revealProblem = task.command.presentation!.revealProblem; let revealProblems = task.command.presentation!.revealProblems;
let revealProblemPanel = terminal && (revealProblem === RevealProblemKind.OnProblem) && (startStopProblemMatcher.numberOfMatches > 0); let revealProblemPanel = terminal && (revealProblems === RevealProblemKind.OnProblem) && (startStopProblemMatcher.numberOfMatches > 0);
if (revealProblemPanel) { if (revealProblemPanel) {
this.panelService.openPanel(Constants.MARKERS_PANEL_ID); this.panelService.openPanel(Constants.MARKERS_PANEL_ID);
} else if (terminal && (reveal === RevealKind.Silent) && ((exitCode !== 0) || (startStopProblemMatcher.numberOfMatches > 0) && startStopProblemMatcher.maxMarkerSeverity && } else if (terminal && (reveal === RevealKind.Silent) && ((exitCode !== 0) || (startStopProblemMatcher.numberOfMatches > 0) && startStopProblemMatcher.maxMarkerSeverity &&
...@@ -688,7 +688,7 @@ export class TerminalTaskSystem implements ITaskSystem { ...@@ -688,7 +688,7 @@ export class TerminalTaskSystem implements ITaskSystem {
if (!terminal) { if (!terminal) {
return Promise.reject(new Error(`Failed to create terminal for task ${task._label}`)); return Promise.reject(new Error(`Failed to create terminal for task ${task._label}`));
} }
let showProblemPanel = task.command.presentation && (task.command.presentation.revealProblem === RevealProblemKind.Always); let showProblemPanel = task.command.presentation && (task.command.presentation.revealProblems === RevealProblemKind.Always);
if (showProblemPanel) { if (showProblemPanel) {
this.panelService.openPanel(Constants.MARKERS_PANEL_ID); this.panelService.openPanel(Constants.MARKERS_PANEL_ID);
} else if (task.command.presentation && (task.command.presentation.reveal === RevealKind.Always)) { } else if (task.command.presentation && (task.command.presentation.reveal === RevealKind.Always)) {
......
...@@ -83,7 +83,7 @@ class PresentationBuilder { ...@@ -83,7 +83,7 @@ class PresentationBuilder {
public result: Tasks.PresentationOptions; public result: Tasks.PresentationOptions;
constructor(public parent: CommandConfigurationBuilder) { constructor(public parent: CommandConfigurationBuilder) {
this.result = { echo: false, reveal: Tasks.RevealKind.Always, revealProblem: Tasks.RevealProblemKind.Never, focus: false, panel: Tasks.PanelKind.Shared, showReuseMessage: true, clear: false }; this.result = { echo: false, reveal: Tasks.RevealKind.Always, revealProblems: Tasks.RevealProblemKind.Never, focus: false, panel: Tasks.PanelKind.Shared, showReuseMessage: true, clear: false };
} }
public echo(value: boolean): PresentationBuilder { public echo(value: boolean): PresentationBuilder {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册