提交 d32ae8bb 编写于 作者: S Sandeep Somavarapu

Fix #11399

上级 9a1d00fe
...@@ -50,6 +50,27 @@ export class ToggleMarkersPanelAction extends TogglePanelAction { ...@@ -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<any> {
/* __GDPR__
"problems.used" : {}
*/
this.telemetryService.publicLog('problems.used');
return this.panelService.openPanel(Constants.MARKERS_PANEL_ID, true);
}
}
export class ToggleErrorsAndWarningsAction extends TogglePanelAction { export class ToggleErrorsAndWarningsAction extends TogglePanelAction {
public static ID: string = 'workbench.action.showErrorsWarnings'; public static ID: string = 'workbench.action.showErrorsWarnings';
......
...@@ -12,7 +12,7 @@ import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRe ...@@ -12,7 +12,7 @@ import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRe
import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions';
import { PanelRegistry, Extensions as PanelExtensions, PanelDescriptor } from 'vs/workbench/browser/panel'; import { PanelRegistry, Extensions as PanelExtensions, PanelDescriptor } from 'vs/workbench/browser/panel';
import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; 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 { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import { MarkersPanel } from 'vs/workbench/parts/markers/browser/markersPanel'; import { MarkersPanel } from 'vs/workbench/parts/markers/browser/markersPanel';
...@@ -63,7 +63,8 @@ export function registerContributions(): void { ...@@ -63,7 +63,8 @@ export function registerContributions(): void {
const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions); const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleMarkersPanelAction, ToggleMarkersPanelAction.ID, ToggleMarkersPanelAction.LABEL, { registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleMarkersPanelAction, ToggleMarkersPanelAction.ID, ToggleMarkersPanelAction.LABEL, {
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_M 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. // 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'); registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleErrorsAndWarningsAction, ToggleErrorsAndWarningsAction.ID, ToggleErrorsAndWarningsAction.LABEL), 'Show Errors and Warnings');
......
...@@ -11,7 +11,9 @@ import { IMarker } from 'vs/platform/markers/common/markers'; ...@@ -11,7 +11,9 @@ import { IMarker } from 'vs/platform/markers/common/markers';
export default class Messages { export default class Messages {
public static MARKERS_PANEL_VIEW_CATEGORY: string = nls.localize('viewCategory', "View"); 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_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"); 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");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册