提交 2b577085 编写于 作者: J Johannes Rieken

move markers panel into electron-browser

上级 b6a0773c
......@@ -35,7 +35,7 @@ import { Model, ExceptionBreakpoint, FunctionBreakpoint, Breakpoint, Expression,
import { ViewModel } from 'vs/workbench/parts/debug/common/debugViewModel';
import * as debugactions from 'vs/workbench/parts/debug/browser/debugActions';
import { ConfigurationManager } from 'vs/workbench/parts/debug/electron-browser/debugConfigurationManager';
import Constants from 'vs/workbench/parts/markers/common/constants';
import Constants from 'vs/workbench/parts/markers/electron-browser/constants';
import { ITaskService, ITaskSummary } from 'vs/workbench/parts/tasks/common/taskService';
import { TaskError } from 'vs/workbench/parts/tasks/common/taskSystem';
import { VIEWLET_ID as EXPLORER_VIEWLET_ID } from 'vs/workbench/parts/files/common/files';
......
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import Messages from 'vs/workbench/parts/markers/common/messages';
import Constants from 'vs/workbench/parts/markers/common/constants';
import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
import { Registry } from 'vs/platform/registry/common/platform';
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
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, 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';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { IMarkersWorkbenchService, MarkersWorkbenchService } from 'vs/workbench/parts/markers/common/markers';
export function registerContributions(): void {
registerSingleton(IMarkersWorkbenchService, MarkersWorkbenchService);
KeybindingsRegistry.registerCommandAndKeybindingRule({
id: Constants.MARKER_OPEN_SIDE_ACTION_ID,
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
when: ContextKeyExpr.and(Constants.MarkerFocusContextKey),
primary: KeyMod.CtrlCmd | KeyCode.Enter,
mac: {
primary: KeyMod.WinCtrl | KeyCode.Enter
},
handler: (accessor, args: any) => {
const markersPanel = (<MarkersPanel>accessor.get(IPanelService).getActivePanel());
markersPanel.openFileAtElement(markersPanel.getFocusElement(), false, true, true);
}
});
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',
'order': 101,
'title': Messages.PROBLEMS_PANEL_CONFIGURATION_TITLE,
'type': 'object',
'properties': {
'problems.autoReveal': {
'description': Messages.PROBLEMS_PANEL_CONFIGURATION_AUTO_REVEAL,
'type': 'boolean',
'default': true
}
}
});
// markers panel
Registry.as<PanelRegistry>(PanelExtensions.Panels).registerPanel(new PanelDescriptor(
MarkersPanel,
Constants.MARKERS_PANEL_ID,
Messages.MARKERS_PANEL_TITLE_PROBLEMS,
'markersPanel',
10,
ToggleMarkersPanelAction.ID
));
// actions
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 (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);
}
......@@ -3,51 +3,115 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { localize } from 'vs/nls';
import { clipboard } from 'electron';
import { Marker } from 'vs/workbench/parts/markers/common/markersModel';
import Constants from 'vs/workbench/parts/markers/common/constants';
import { CommandsRegistry, ICommandHandler } from 'vs/platform/commands/common/commands';
import { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { KeybindingsRegistry, IKeybindings } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import { MarkersPanel } from 'vs/workbench/parts/markers/browser/markersPanel';
import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions';
import { KeybindingsRegistry, IKeybindings } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { localize } from 'vs/nls';
import { Marker } from 'vs/workbench/parts/markers/electron-browser/markersModel';
import { MarkersPanel } from 'vs/workbench/parts/markers/electron-browser/markersPanel';
import { MenuId, MenuRegistry, SyncActionDescriptor } from 'vs/platform/actions/common/actions';
import { PanelRegistry, Extensions as PanelExtensions, PanelDescriptor } from 'vs/workbench/browser/panel';
import { Registry } from 'vs/platform/registry/common/platform';
import { ToggleMarkersPanelAction, ShowProblemsPanelAction } from 'vs/workbench/parts/markers/electron-browser/markersPanelActions';
import Constants from 'vs/workbench/parts/markers/electron-browser/constants';
import Messages from 'vs/workbench/parts/markers/electron-browser/messages';
import './markers';
import './markersFileDecorations';
export function registerContributions(): void {
registerAction({
id: Constants.MARKER_COPY_ACTION_ID,
title: localize('copyMarker', "Copy"),
handler(accessor) {
copyMarker(accessor.get(IPanelService));
},
menu: {
menuId: MenuId.ProblemsPanelContext,
when: Constants.MarkerFocusContextKey,
group: 'navigation'
},
keybinding: {
keys: {
primary: KeyMod.CtrlCmd | KeyCode.KEY_C
},
when: Constants.MarkerFocusContextKey
KeybindingsRegistry.registerCommandAndKeybindingRule({
id: Constants.MARKER_OPEN_SIDE_ACTION_ID,
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
when: ContextKeyExpr.and(Constants.MarkerFocusContextKey),
primary: KeyMod.CtrlCmd | KeyCode.Enter,
mac: {
primary: KeyMod.WinCtrl | KeyCode.Enter
},
handler: (accessor, args: any) => {
const markersPanel = (<MarkersPanel>accessor.get(IPanelService).getActivePanel());
markersPanel.openFileAtElement(markersPanel.getFocusElement(), false, true, true);
}
});
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',
'order': 101,
'title': Messages.PROBLEMS_PANEL_CONFIGURATION_TITLE,
'type': 'object',
'properties': {
'problems.autoReveal': {
'description': Messages.PROBLEMS_PANEL_CONFIGURATION_AUTO_REVEAL,
'type': 'boolean',
'default': true
}
});
registerAction({
id: Constants.MARKER_COPY_MESSAGE_ACTION_ID,
title: localize('copyMarkerMessage', "Copy Message"),
handler(accessor) {
copyMessage(accessor.get(IPanelService));
}
});
// markers panel
Registry.as<PanelRegistry>(PanelExtensions.Panels).registerPanel(new PanelDescriptor(
MarkersPanel,
Constants.MARKERS_PANEL_ID,
Messages.MARKERS_PANEL_TITLE_PROBLEMS,
'markersPanel',
10,
ToggleMarkersPanelAction.ID
));
// actions
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 (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);
registerAction({
id: Constants.MARKER_COPY_ACTION_ID,
title: localize('copyMarker', "Copy"),
handler(accessor) {
copyMarker(accessor.get(IPanelService));
},
menu: {
menuId: MenuId.ProblemsPanelContext,
when: Constants.MarkerFocusContextKey,
group: 'navigation'
},
keybinding: {
keys: {
primary: KeyMod.CtrlCmd | KeyCode.KEY_C
},
menu: {
menuId: MenuId.ProblemsPanelContext,
when: Constants.MarkerFocusContextKey,
group: 'navigation'
}
});
}
when: Constants.MarkerFocusContextKey
}
});
registerAction({
id: Constants.MARKER_COPY_MESSAGE_ACTION_ID,
title: localize('copyMarkerMessage', "Copy Message"),
handler(accessor) {
copyMessage(accessor.get(IPanelService));
},
menu: {
menuId: MenuId.ProblemsPanelContext,
when: Constants.MarkerFocusContextKey,
group: 'navigation'
}
});
function copyMarker(panelService: IPanelService) {
const activePanel = panelService.getActivePanel();
......
......@@ -4,14 +4,15 @@
*--------------------------------------------------------------------------------------------*/
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { MarkersModel, FilterOptions } from 'vs/workbench/parts/markers/common/markersModel';
import { MarkersModel, FilterOptions } from './markersModel';
import { Disposable } from 'vs/base/common/lifecycle';
import { IMarkerService } from 'vs/platform/markers/common/markers';
import { IActivityService, NumberBadge } from 'vs/workbench/services/activity/common/activity';
import { localize } from 'vs/nls';
import Constants from 'vs/workbench/parts/markers/common/constants';
import Constants from './constants';
import URI from 'vs/base/common/uri';
import Event, { Emitter } from 'vs/base/common/event';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
export const IMarkersWorkbenchService = createDecorator<IMarkersWorkbenchService>('markersWorkbenchService');
......@@ -62,3 +63,6 @@ export class MarkersWorkbenchService extends Disposable implements IMarkersWorkb
this.activityService.showActivity(Constants.MARKERS_PANEL_ID, new NumberBadge(filtered, () => message));
}
}
registerSingleton(IMarkersWorkbenchService, MarkersWorkbenchService);
......@@ -10,7 +10,7 @@ import URI from 'vs/base/common/uri';
import { Range, IRange } from 'vs/editor/common/core/range';
import { IMarker } from 'vs/platform/markers/common/markers';
import { IFilter, IMatch, or, matchesContiguousSubString, matchesPrefix, matchesFuzzy } from 'vs/base/common/filters';
import Messages from 'vs/workbench/parts/markers/common/messages';
import Messages from 'vs/workbench/parts/markers/electron-browser/messages';
import { Schemas } from 'vs/base/common/network';
import { groupBy, isFalsyOrEmpty } from 'vs/base/common/arrays';
import { values } from 'vs/base/common/map';
......
......@@ -17,20 +17,20 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService';
import { Panel } from 'vs/workbench/browser/panel';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import Constants from 'vs/workbench/parts/markers/common/constants';
import { Marker, Resource } from 'vs/workbench/parts/markers/common/markersModel';
import { Controller } from 'vs/workbench/parts/markers/browser/markersTreeController';
import * as Viewer from 'vs/workbench/parts/markers/browser/markersTreeViewer';
import Constants from 'vs/workbench/parts/markers/electron-browser/constants';
import { Marker, Resource } from 'vs/workbench/parts/markers/electron-browser/markersModel';
import { Controller } from 'vs/workbench/parts/markers/electron-browser/markersTreeController';
import * as Viewer from 'vs/workbench/parts/markers/electron-browser/markersTreeViewer';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { CollapseAllAction, FilterAction, FilterInputBoxActionItem } from 'vs/workbench/parts/markers/browser/markersPanelActions';
import { CollapseAllAction, FilterAction, FilterInputBoxActionItem } from 'vs/workbench/parts/markers/electron-browser/markersPanelActions';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import Messages from 'vs/workbench/parts/markers/common/messages';
import Messages from 'vs/workbench/parts/markers/electron-browser/messages';
import { RangeHighlightDecorations } from 'vs/workbench/browser/parts/editor/rangeDecorations';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { debounceEvent } from 'vs/base/common/event';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { TreeResourceNavigator, WorkbenchTree } from 'vs/platform/list/browser/listService';
import { IMarkersWorkbenchService } from 'vs/workbench/parts/markers/common/markers';
import { IMarkersWorkbenchService } from 'vs/workbench/parts/markers/electron-browser/markers';
import { SimpleFileResourceDragAndDrop } from 'vs/workbench/browser/dnd';
export class MarkersPanel extends Panel {
......
......@@ -14,9 +14,9 @@ import { KeyCode } from 'vs/base/common/keyCodes';
import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { TogglePanelAction } from 'vs/workbench/browser/panel';
import Messages from 'vs/workbench/parts/markers/common/messages';
import Constants from 'vs/workbench/parts/markers/common/constants';
import { MarkersPanel } from 'vs/workbench/parts/markers/browser/markersPanel';
import Messages from 'vs/workbench/parts/markers/electron-browser/messages';
import Constants from 'vs/workbench/parts/markers/electron-browser/constants';
import { MarkersPanel } from 'vs/workbench/parts/markers/electron-browser/markersPanel';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
......@@ -24,7 +24,7 @@ import { CollapseAllAction as TreeCollapseAction } from 'vs/base/parts/tree/brow
import Tree = require('vs/base/parts/tree/browser/tree');
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { attachInputBoxStyler } from 'vs/platform/theme/common/styler';
import { IMarkersWorkbenchService } from 'vs/workbench/parts/markers/common/markers';
import { IMarkersWorkbenchService } from 'vs/workbench/parts/markers/electron-browser/markers';
export class ToggleMarkersPanelAction extends TogglePanelAction {
......@@ -148,4 +148,4 @@ export class FilterInputBoxActionItem extends BaseActionItem {
return;
}
}
}
\ No newline at end of file
}
......@@ -7,7 +7,7 @@
import { TPromise } from 'vs/base/common/winjs.base';
import * as mouse from 'vs/base/browser/mouseEvent';
import tree = require('vs/base/parts/tree/browser/tree');
import { MarkersModel } from 'vs/workbench/parts/markers/common/markersModel';
import { MarkersModel } from 'vs/workbench/parts/markers/electron-browser/markersModel';
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { IMenuService, MenuId } from 'vs/platform/actions/common/actions';
import { IAction } from 'vs/base/common/actions';
......
......@@ -13,8 +13,8 @@ import { CountBadge } from 'vs/base/browser/ui/countBadge/countBadge';
import { FileLabel, ResourceLabel } from 'vs/workbench/browser/labels';
import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel';
import { IMarker } from 'vs/platform/markers/common/markers';
import { MarkersModel, Resource, Marker } from 'vs/workbench/parts/markers/common/markersModel';
import Messages from 'vs/workbench/parts/markers/common/messages';
import { MarkersModel, Resource, Marker } from 'vs/workbench/parts/markers/electron-browser/markersModel';
import Messages from 'vs/workbench/parts/markers/electron-browser/messages';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { attachBadgeStyler } from 'vs/platform/theme/common/styler';
import { IThemeService } from 'vs/platform/theme/common/themeService';
......
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { registerContributions } from 'vs/workbench/parts/markers/browser/markersWorkbenchContributions';
import { registerContributions as registerElectronContributions } from 'vs/workbench/parts/markers/electron-browser/markersElectronContributions';
import './browser/markersFileDecorations';
registerContributions();
registerElectronContributions();
......@@ -9,7 +9,7 @@ import assert = require('assert');
import URI from 'vs/base/common/uri';
import Severity from 'vs/base/common/severity';
import { IMarker } from 'vs/platform/markers/common/markers';
import { MarkersModel, Marker, Resource } from 'vs/workbench/parts/markers/common/markersModel';
import { MarkersModel, Marker, Resource } from 'vs/workbench/parts/markers/electron-browser/markersModel';
class TestMarkersModel extends MarkersModel {
......
......@@ -58,7 +58,7 @@ import { IQuickOpenRegistry, Extensions as QuickOpenExtensions, QuickOpenHandler
import { IQuickOpenService, IPickOpenEntry, IPickOpenAction, IPickOpenItem } from 'vs/platform/quickOpen/common/quickOpen';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import Constants from 'vs/workbench/parts/markers/common/constants';
import Constants from 'vs/workbench/parts/markers/electron-browser/constants';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver';
......
......@@ -63,8 +63,7 @@ import 'vs/workbench/parts/debug/electron-browser/repl';
import 'vs/workbench/parts/debug/browser/debugEditorActions';
import 'vs/workbench/parts/debug/browser/debugViewlet'; // can be packaged separately
import 'vs/workbench/parts/markers/markers.contribution';
import 'vs/workbench/parts/markers/browser/markersPanel'; // can be packaged separately
import 'vs/workbench/parts/markers/electron-browser/markers.contribution';
import 'vs/workbench/parts/html/electron-browser/html.contribution';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册