From d32ae8bb13c5a507bb0afb334ccb24a7af8e05cc Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Sun, 29 Oct 2017 19:35:10 +0100 Subject: [PATCH] Fix #11399 --- .../markers/browser/markersPanelActions.ts | 21 +++++++++++++++++++ .../browser/markersWorkbenchContributions.ts | 5 +++-- .../parts/markers/common/messages.ts | 4 +++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/parts/markers/browser/markersPanelActions.ts b/src/vs/workbench/parts/markers/browser/markersPanelActions.ts index 12c2d2ad242..1b755f1d0d3 100644 --- a/src/vs/workbench/parts/markers/browser/markersPanelActions.ts +++ b/src/vs/workbench/parts/markers/browser/markersPanelActions.ts @@ -50,6 +50,27 @@ export class ToggleMarkersPanelAction extends TogglePanelAction { } } +export class ShowProblemsPanelAction extends Action { + + public static ID = 'workbench.action.problems.show'; + public static LABEL = Messages.MARKERS_PANEL_SHOW_LABEL; + + constructor(id: string, label: string, + @IPanelService private panelService: IPanelService, + @ITelemetryService private telemetryService: ITelemetryService + ) { + super(id, label); + } + + public run(): TPromise { + /* __GDPR__ + "problems.used" : {} + */ + this.telemetryService.publicLog('problems.used'); + return this.panelService.openPanel(Constants.MARKERS_PANEL_ID, true); + } +} + export class ToggleErrorsAndWarningsAction extends TogglePanelAction { public static ID: string = 'workbench.action.showErrorsWarnings'; diff --git a/src/vs/workbench/parts/markers/browser/markersWorkbenchContributions.ts b/src/vs/workbench/parts/markers/browser/markersWorkbenchContributions.ts index 39970c806b9..1ab41b88d24 100644 --- a/src/vs/workbench/parts/markers/browser/markersWorkbenchContributions.ts +++ b/src/vs/workbench/parts/markers/browser/markersWorkbenchContributions.ts @@ -12,7 +12,7 @@ import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRe import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions'; import { PanelRegistry, Extensions as PanelExtensions, PanelDescriptor } from 'vs/workbench/browser/panel'; import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -import { ToggleMarkersPanelAction, ToggleErrorsAndWarningsAction } from 'vs/workbench/parts/markers/browser/markersPanelActions'; +import { ToggleMarkersPanelAction, ToggleErrorsAndWarningsAction, ShowProblemsPanelAction } from 'vs/workbench/parts/markers/browser/markersPanelActions'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { MarkersPanel } from 'vs/workbench/parts/markers/browser/markersPanel'; @@ -63,7 +63,8 @@ export function registerContributions(): void { const registry = Registry.as(ActionExtensions.WorkbenchActions); registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleMarkersPanelAction, ToggleMarkersPanelAction.ID, ToggleMarkersPanelAction.LABEL, { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_M - }), 'View: Show Problems', Messages.MARKERS_PANEL_VIEW_CATEGORY); + }), 'View: Toggle Problems', Messages.MARKERS_PANEL_VIEW_CATEGORY); + registry.registerWorkbenchAction(new SyncActionDescriptor(ShowProblemsPanelAction, ShowProblemsPanelAction.ID, ShowProblemsPanelAction.LABEL), 'View: Show Problems', Messages.MARKERS_PANEL_VIEW_CATEGORY); // Retaining old action to show errors and warnings, so that custom bindings to this action for existing users works. registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleErrorsAndWarningsAction, ToggleErrorsAndWarningsAction.ID, ToggleErrorsAndWarningsAction.LABEL), 'Show Errors and Warnings'); diff --git a/src/vs/workbench/parts/markers/common/messages.ts b/src/vs/workbench/parts/markers/common/messages.ts index 81d430a00e7..1098da633a1 100644 --- a/src/vs/workbench/parts/markers/common/messages.ts +++ b/src/vs/workbench/parts/markers/common/messages.ts @@ -11,7 +11,9 @@ import { IMarker } from 'vs/platform/markers/common/markers'; export default class Messages { public static MARKERS_PANEL_VIEW_CATEGORY: string = nls.localize('viewCategory', "View"); - public static MARKERS_PANEL_TOGGLE_LABEL: string = nls.localize('problems.view.show.label', "Show Problems"); + public static MARKERS_PANEL_TOGGLE_LABEL: string = nls.localize('problems.view.toggle.label', "Toggle Problems"); + public static MARKERS_PANEL_SHOW_LABEL: string = nls.localize('problems.view.show.label', "Show Problems"); + public static MARKERS_PANEL_HIDE_LABEL: string = nls.localize('problems.view.hide.label', "Hide Problems"); public static PROBLEMS_PANEL_CONFIGURATION_TITLE: string = nls.localize('problems.panel.configuration.title', "Problems View"); public static PROBLEMS_PANEL_CONFIGURATION_AUTO_REVEAL: string = nls.localize('problems.panel.configuration.autoreveal', "Controls if Problems view should automatically reveal files when opening them"); -- GitLab