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

move markers panel

上级 3cac7982
......@@ -12,9 +12,9 @@ import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/co
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { localize } from 'vs/nls';
import { Marker, RelatedInformation } from 'vs/workbench/contrib/markers/browser/markersModel';
import { MarkersPanel, MarkersView, getMarkersView } from 'vs/workbench/contrib/markers/browser/markersPanel';
import { MarkersView, getMarkersView } from 'vs/workbench/contrib/markers/browser/markersPanel';
import { MenuId, MenuRegistry, SyncActionDescriptor, registerAction } from 'vs/platform/actions/common/actions';
import { PanelRegistry, Extensions as PanelExtensions, PanelDescriptor } from 'vs/workbench/browser/panel';
import { PanelRegistry, Extensions as PanelExtensions, PanelDescriptor, PaneCompositePanel } from 'vs/workbench/browser/panel';
import { Registry } from 'vs/platform/registry/common/platform';
import { ToggleMarkersPanelAction, ShowProblemsPanelAction } from 'vs/workbench/contrib/markers/browser/markersPanelActions';
import Constants from 'vs/workbench/contrib/markers/browser/constants';
......@@ -30,6 +30,14 @@ import { IStatusbarEntryAccessor, IStatusbarService, StatusbarAlignment, IStatus
import { IMarkerService, MarkerStatistics } from 'vs/platform/markers/common/markers';
import { CommandsRegistry } from 'vs/platform/commands/common/commands';
import { ViewContainer, IViewContainersRegistry, Extensions as ViewContainerExtensions, ViewContainerLocation, IViewsRegistry } from 'vs/workbench/common/views';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer';
registerSingleton(IMarkersWorkbenchService, MarkersWorkbenchService, false);
......@@ -92,7 +100,29 @@ Registry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfigurat
});
// markers view container
const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer(Constants.MARKERS_PANEL_ID, ViewContainerLocation.Panel);
Registry.as<IViewsRegistry>(ViewContainerExtensions.ViewsRegistry).registerViews([{
id: Constants.MARKERS_VIEW_ID,
name: Messages.MARKERS_PANEL_TITLE_PROBLEMS,
canToggleVisibility: false,
ctorDescriptor: { ctor: MarkersView },
}], VIEW_CONTAINER);
// markers panel
class MarkersPanel extends PaneCompositePanel {
constructor(
@ITelemetryService telemetryService: ITelemetryService,
@IStorageService storageService: IStorageService,
@IInstantiationService instantiationService: IInstantiationService,
@IThemeService themeService: IThemeService,
@IContextMenuService contextMenuService: IContextMenuService,
@IExtensionService extensionService: IExtensionService,
@IWorkspaceContextService contextService: IWorkspaceContextService) {
super(Constants.MARKERS_PANEL_ID, instantiationService.createInstance(ViewPaneContainer, Constants.MARKERS_PANEL_ID, Constants.MARKERS_PANEL_STORAGE_ID, { showHeaderInTitleWhenSingleView: true, donotShowViewTitleWhenSingleView: true }),
telemetryService, storageService, instantiationService, themeService, contextMenuService, extensionService, contextService);
}
}
Registry.as<PanelRegistry>(PanelExtensions.Panels).registerPanel(PanelDescriptor.create(
MarkersPanel,
Constants.MARKERS_PANEL_ID,
......@@ -102,14 +132,6 @@ Registry.as<PanelRegistry>(PanelExtensions.Panels).registerPanel(PanelDescriptor
ToggleMarkersPanelAction.ID
));
const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer(Constants.MARKERS_PANEL_ID, ViewContainerLocation.Panel);
Registry.as<IViewsRegistry>(ViewContainerExtensions.ViewsRegistry).registerViews([{
id: Constants.MARKERS_VIEW_ID,
name: Messages.MARKERS_PANEL_TITLE_PROBLEMS,
canToggleVisibility: false,
ctorDescriptor: { ctor: MarkersView },
}], VIEW_CONTAINER);
// workbench
const workbenchRegistry = Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench);
workbenchRegistry.registerWorkbenchContribution(ActivityUpdater, LifecyclePhase.Restored);
......@@ -251,9 +273,9 @@ async function copyRelatedInformationMessage(panelService: IPanelService, clipbo
}
function focusProblemsView(panelService: IPanelService) {
const activePanel = panelService.getActivePanel();
if (activePanel instanceof MarkersPanel) {
activePanel.focus();
const markersView = getMarkersView(panelService);
if (markersView) {
markersView.focus();
}
}
......
......@@ -48,8 +48,7 @@ import { IAccessibilityService } from 'vs/platform/accessibility/common/accessib
import { PANEL_BACKGROUND } from 'vs/workbench/common/theme';
import { KeyCode } from 'vs/base/common/keyCodes';
import { editorLightBulbForeground, editorLightBulbAutoFixForeground } from 'vs/platform/theme/common/colorRegistry';
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
import { ViewPaneContainer, ViewPane, IViewPaneOptions } from 'vs/workbench/browser/parts/views/viewPaneContainer';
import { ViewPane, IViewPaneOptions } from 'vs/workbench/browser/parts/views/viewPaneContainer';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
export function getMarkersView(panelService: IPanelService): MarkersView | undefined {
......@@ -72,22 +71,6 @@ function createResourceMarkersIterator(resourceMarkers: ResourceMarkers): Iterat
}
export class MarkersPanel extends PaneCompositePanel {
constructor(
@ITelemetryService telemetryService: ITelemetryService,
@IStorageService storageService: IStorageService,
@IInstantiationService instantiationService: IInstantiationService,
@IThemeService themeService: IThemeService,
@IContextMenuService contextMenuService: IContextMenuService,
@IExtensionService extensionService: IExtensionService,
@IWorkspaceContextService contextService: IWorkspaceContextService) {
super(Constants.MARKERS_PANEL_ID, instantiationService.createInstance(ViewPaneContainer, Constants.MARKERS_PANEL_ID, Constants.MARKERS_PANEL_STORAGE_ID, { showHeaderInTitleWhenSingleView: true, donotShowViewTitleWhenSingleView: true }),
telemetryService, storageService, instantiationService, themeService, contextMenuService, extensionService, contextService);
}
}
export class MarkersView extends ViewPane implements IMarkerFilterController {
private lastSelectedRelativeTop: number = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册