提交 78adc337 编写于 作者: S Sandeep Somavarapu

#7974 - Support old action to show errors and warnings

上级 d992705a
...@@ -19,7 +19,7 @@ import Constants from 'vs/workbench/parts/markers/common/constants'; ...@@ -19,7 +19,7 @@ import Constants from 'vs/workbench/parts/markers/common/constants';
import { FilterOptions } from 'vs/workbench/parts/markers/common/markersModel'; import { FilterOptions } from 'vs/workbench/parts/markers/common/markersModel';
import { MarkersPanel } from 'vs/workbench/parts/markers/browser/markersPanel'; import { MarkersPanel } from 'vs/workbench/parts/markers/browser/markersPanel';
import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IPartService } from 'vs/workbench/services/part/common/partService';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { CollapseAllAction as TreeCollapseAction } from 'vs/base/parts/tree/browser/treeDefaults'; import { CollapseAllAction as TreeCollapseAction } from 'vs/base/parts/tree/browser/treeDefaults';
...@@ -47,6 +47,28 @@ export class ToggleProblemsPanelAction extends TogglePanelAction { ...@@ -47,6 +47,28 @@ export class ToggleProblemsPanelAction extends TogglePanelAction {
} }
} }
export class ToggleErrorsAndWarningsAction extends TogglePanelAction {
public static ID:string = 'workbench.action.showErrorsWarnings';
constructor(id: string, label: string,
@IPartService private partService: IPartService,
@IPanelService panelService: IPanelService,
@IWorkbenchEditorService editorService: IWorkbenchEditorService,
@ITelemetryService private telemetryService: ITelemetryService
) {
super(id, label, Constants.MARKERS_PANEL_ID, panelService, editorService);
}
public run(): TPromise<any> {
let promise= super.run();
if (this.isPanelFocussed()) {
this.telemetryService.publicLog('problems.used');
}
return promise;
}
}
export class CollapseAllAction extends TreeCollapseAction { export class CollapseAllAction extends TreeCollapseAction {
constructor(viewer: Tree.ITree, enabled: boolean, constructor(viewer: Tree.ITree, enabled: boolean,
......
...@@ -38,11 +38,14 @@ export function registerContributions(): void { ...@@ -38,11 +38,14 @@ export function registerContributions(): void {
'markersPanel' 'markersPanel'
)); ));
<IWorkbenchActionRegistry>platform.Registry.as(ActionExtensions.WorkbenchActions).registerWorkbenchAction(new SyncActionDescriptor( let registry = <IWorkbenchActionRegistry>platform.Registry.as(ActionExtensions.WorkbenchActions);
problemsPanelActions.ToggleProblemsPanelAction, problemsPanelActions.ToggleProblemsPanelAction.ID, Messages.MARKERS_PANEL_TOGGLE_LABEL, {
registry.registerWorkbenchAction(new SyncActionDescriptor(problemsPanelActions.ToggleProblemsPanelAction, problemsPanelActions.ToggleProblemsPanelAction.ID, Messages.MARKERS_PANEL_TOGGLE_LABEL, {
primary: null, primary: null,
win: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_M }, win: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_M },
linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_M }, linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_M },
mac: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_M } mac: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_M }
}), 'View: ' + Messages.MARKERS_PANEL_TOGGLE_LABEL, Messages.MARKERS_PANEL_VIEW_CATEGORY); }), 'View: ' + Messages.MARKERS_PANEL_TOGGLE_LABEL, Messages.MARKERS_PANEL_VIEW_CATEGORY);
registry.registerWorkbenchAction(new SyncActionDescriptor(problemsPanelActions.ToggleErrorsAndWarningsAction, problemsPanelActions.ToggleErrorsAndWarningsAction.ID, Messages.MARKERS_PANEL_TOGGLE_LABEL), Messages.SHOW_ERRORS_WARNINGS_ACTION_LABEL);
} }
\ No newline at end of file
...@@ -57,4 +57,6 @@ export default class Messages { ...@@ -57,4 +57,6 @@ export default class Messages {
: nls.localize('problems.tree.aria.label.marker.nosource', "Problem: {0} at line {1} and column {2}", marker.message, marker.startLineNumber, marker.startColumn); : nls.localize('problems.tree.aria.label.marker.nosource', "Problem: {0} at line {1} and column {2}", marker.message, marker.startLineNumber, marker.startColumn);
} }
} }
public static SHOW_ERRORS_WARNINGS_ACTION_LABEL:string= nls.localize('errors.warnings.show.label', "Errors and Warnings");
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册