diff --git a/src/vs/workbench/parts/debug/browser/debugViewRegistry.ts b/src/vs/workbench/parts/debug/browser/debugViewRegistry.ts index 326cdac7f67ee6761b8d7aa26fd3b1bb6fb862f0..0a2ae20976071b4b517d1fba677d8bcd6794e97f 100644 --- a/src/vs/workbench/parts/debug/browser/debugViewRegistry.ts +++ b/src/vs/workbench/parts/debug/browser/debugViewRegistry.ts @@ -13,24 +13,24 @@ export interface IDebugViewConstructorSignature { } export interface IDebugViewRegistry { - registerDebugView(view: IDebugViewConstructorSignature, order: number): void; - getDebugViews(): IDebugViewConstructorSignature[]; + registerDebugView(view: IDebugViewConstructorSignature, order: number, weight: number): void; + getDebugViews(): { view: IDebugViewConstructorSignature, weight: number }[]; } class DebugViewRegistryImpl implements IDebugViewRegistry { - private debugViews: { view: IDebugViewConstructorSignature, order: number }[]; + private debugViews: { view: IDebugViewConstructorSignature, order: number, weight: number }[]; constructor() { this.debugViews = []; } - public registerDebugView(view: IDebugViewConstructorSignature, order: number): void { - this.debugViews.push({ view, order }); + public registerDebugView(view: IDebugViewConstructorSignature, order: number, weight: number): void { + this.debugViews.push({ view, order, weight }); } - public getDebugViews(): IDebugViewConstructorSignature[] { + public getDebugViews(): { view: IDebugViewConstructorSignature, weight: number }[] { return this.debugViews.sort((first, second) => first.order - second.order) - .map(viewWithOrder => viewWithOrder.view); + .map(viewWithOrder => ({ view: viewWithOrder.view, weight: viewWithOrder.weight })); } } diff --git a/src/vs/workbench/parts/debug/browser/debugViewlet.ts b/src/vs/workbench/parts/debug/browser/debugViewlet.ts index 6b69091ea29f4886b4fa5aaf422963d8a8cc3375..842e0caf7d3764e762caa930415a577ee34f9cf4 100644 --- a/src/vs/workbench/parts/debug/browser/debugViewlet.ts +++ b/src/vs/workbench/parts/debug/browser/debugViewlet.ts @@ -60,15 +60,18 @@ export class DebugViewlet extends Viewlet { this.$el = parent.div().addClass('debug-viewlet'); const actionRunner = this.getActionRunner(); - this.views = DebugViewRegistry.getDebugViews().map(viewConstructor => this.instantiationService.createInstance( - viewConstructor, + const registeredViews = DebugViewRegistry.getDebugViews(); + this.views = registeredViews.map(viewConstructor => this.instantiationService.createInstance( + viewConstructor.view, actionRunner, this.viewletSettings) ); this.splitView = new SplitView(this.$el.getHTMLElement()); this.toDispose.push(this.splitView); - this.views.forEach(v => this.splitView.addView(v)); + for (let i = 0; i < this.views.length; i++) { + this.splitView.addView(this.views[i], registeredViews[i].weight); + } return TPromise.as(null); } diff --git a/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts b/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts index 54106b76164c41f75467c73b87f509f1342fafbe..964f626725246ba4795ea3624ad1b2ff29643c65 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts @@ -94,10 +94,10 @@ Registry.as(PanelExtensions.Panels).registerPanel(new PanelDescri Registry.as(PanelExtensions.Panels).setDefaultPanelId(REPL_ID); // Register default debug views -DebugViewRegistry.registerDebugView(VariablesView, 10); -DebugViewRegistry.registerDebugView(WatchExpressionsView, 20); -DebugViewRegistry.registerDebugView(CallStackView, 30); -DebugViewRegistry.registerDebugView(BreakpointsView, 40); +DebugViewRegistry.registerDebugView(VariablesView, 10, 40); +DebugViewRegistry.registerDebugView(WatchExpressionsView, 20, 10); +DebugViewRegistry.registerDebugView(CallStackView, 30, 30); +DebugViewRegistry.registerDebugView(BreakpointsView, 40, 20); // register action to open viewlet const registry = Registry.as(WorkbenchActionRegistryExtensions.WorkbenchActions);