debug: introduce order when contributing debug views

This commit is contained in:
isidor
2016-04-05 17:08:42 +02:00
parent f56ccb001a
commit 2e8f235013
3 changed files with 8 additions and 8 deletions
@@ -64,7 +64,7 @@ export class DebugViewlet extends viewlet.Viewlet {
if (this.contextService.getWorkspace()) {
const actionRunner = this.getActionRunner();
const viewDescriptors = debug.DebugViewRegistry.getDebugViews();
const viewDescriptors = debug.DebugViewRegistry.getDebugViews().sort((first, second) => first.order - second.order);
this.views = viewDescriptors.map(dsc => this.instantiationService.createInstance(dsc, actionRunner, this.viewletSettings));
this.splitView = new splitview.SplitView(this.$el.getHTMLElement());
+3 -3
View File
@@ -351,9 +351,9 @@ export interface IDebugEditorContribution extends editor.IEditorContribution {
// Debug view descriptors and registration
export class DebugViewDescriptor extends SyncDescriptor<CollapsibleViewletView | AdaptiveCollapsibleViewletView> {
// constructor(ctorName: string, public id: string, public name: string, public cssClass: string) {
// super(ctorName);
// }
constructor(ctor: any, public order: number) {
super(ctor);
}
}
export interface IDebugViewRegistry {
@@ -85,10 +85,10 @@ const openViewletKb: IKeybindings = {
(<panel.PanelRegistry>platform.Registry.as(panel.Extensions.Panels)).setDefaultPanelId(debug.REPL_ID);
// Register default debug views
debug.DebugViewRegistry.registerDebugView(new debug.DebugViewDescriptor(VariablesView));
debug.DebugViewRegistry.registerDebugView(new debug.DebugViewDescriptor(WatchExpressionsView));
debug.DebugViewRegistry.registerDebugView(new debug.DebugViewDescriptor(CallStackView));
debug.DebugViewRegistry.registerDebugView(new debug.DebugViewDescriptor(BreakpointsView));
debug.DebugViewRegistry.registerDebugView(new debug.DebugViewDescriptor(VariablesView, 10));
debug.DebugViewRegistry.registerDebugView(new debug.DebugViewDescriptor(WatchExpressionsView, 20));
debug.DebugViewRegistry.registerDebugView(new debug.DebugViewDescriptor(CallStackView, 30));
debug.DebugViewRegistry.registerDebugView(new debug.DebugViewDescriptor(BreakpointsView, 40));
// register action to open viewlet
const registry = (<wbaregistry.IWorkbenchActionRegistry> platform.Registry.as(wbaregistry.Extensions.WorkbenchActions));