提交 a08d1550 编写于 作者: B Benjamin Pasero

fix #16852

上级 9a2d1d20
......@@ -54,19 +54,6 @@ export class ShowProblemsPanelAction extends Action {
}
}
export class ToggleErrorsAndWarningsAction extends TogglePanelAction {
public static ID: string = 'workbench.action.showErrorsWarnings';
public static readonly LABEL = Messages.SHOW_ERRORS_WARNINGS_ACTION_LABEL;
constructor(id: string, label: string,
@IPartService partService: IPartService,
@IPanelService panelService: IPanelService,
) {
super(id, label, Constants.MARKERS_PANEL_ID, panelService, partService);
}
}
export class CollapseAllAction extends TreeCollapseAction {
constructor(viewer: Tree.ITree, enabled: boolean) {
......
......@@ -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, ShowProblemsPanelAction } from 'vs/workbench/parts/markers/browser/markersPanelActions';
import { ToggleMarkersPanelAction, 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';
......@@ -33,6 +33,16 @@ export function registerContributions(): void {
}
});
KeybindingsRegistry.registerCommandAndKeybindingRule({
id: Constants.MARKER_SHOW_PANEL_ID,
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
when: undefined,
primary: undefined,
handler: (accessor, args: any) => {
accessor.get(IPanelService).openPanel(Constants.MARKERS_PANEL_ID);
}
});
// configuration
Registry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfiguration({
'id': 'problems',
......@@ -63,9 +73,6 @@ export function registerContributions(): void {
const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleMarkersPanelAction, ToggleMarkersPanelAction.ID, ToggleMarkersPanelAction.LABEL, {
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_M
}), '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');
}), 'View: Toggle Problems (Errors, Warnings, Infos)', Messages.MARKERS_PANEL_VIEW_CATEGORY);
registry.registerWorkbenchAction(new SyncActionDescriptor(ShowProblemsPanelAction, ShowProblemsPanelAction.ID, ShowProblemsPanelAction.LABEL), 'View: Focus Problems (Errors, Warnings, Infos)', Messages.MARKERS_PANEL_VIEW_CATEGORY);
}
......@@ -10,6 +10,7 @@ export default {
MARKER_COPY_ACTION_ID: 'problems.action.copy',
MARKER_COPY_MESSAGE_ACTION_ID: 'problems.action.copyMessage',
MARKER_OPEN_SIDE_ACTION_ID: 'problems.action.openToSide',
MARKER_SHOW_PANEL_ID: 'workbench.action.showErrorsWarnings',
MarkerFocusContextKey: new RawContextKey<boolean>('problemFocus', true)
};
......@@ -11,8 +11,8 @@ 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.toggle.label', "Toggle Problems");
public static MARKERS_PANEL_SHOW_LABEL: string = nls.localize('problems.view.focus.label', "Focus Problems");
public static MARKERS_PANEL_TOGGLE_LABEL: string = nls.localize('problems.view.toggle.label', "Toggle Problems (Errors, Warnings, Infos)");
public static MARKERS_PANEL_SHOW_LABEL: string = nls.localize('problems.view.focus.label', "Focus Problems (Errors, Warnings, Infos)");
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");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册