rework panel to not need platform (#5270)

This commit is contained in:
Anthony Dresser
2019-04-30 13:19:21 -07:00
committed by GitHub
parent f70369c2a6
commit 48682bacde
14 changed files with 107 additions and 97 deletions

View File

@@ -131,7 +131,7 @@ export class QueryResultsEditor extends BaseEditor {
this.styleSheet.remove();
parent.appendChild(this.styleSheet);
if (!this.resultsView) {
this.resultsView = this._register(new QueryResultsView(parent, this._instantiationService, this._queryModelService));
this.resultsView = this._register(this._instantiationService.createInstance(QueryResultsView, parent));
}
}

View File

@@ -20,6 +20,8 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import * as DOM from 'vs/base/browser/dom';
import { Event } from 'vs/base/common/event';
import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle';
import { attachTabbedPanelStyler } from 'sql/platform/theme/common/styler';
import { IThemeService } from 'vs/platform/theme/common/themeService';
class ResultsView extends Disposable implements IPanelView {
private panelViewlet: PanelViewlet;
@@ -182,7 +184,8 @@ export class QueryResultsView extends Disposable {
constructor(
container: HTMLElement,
@IInstantiationService private instantiationService: IInstantiationService,
@IQueryModelService private queryModelService: IQueryModelService
@IQueryModelService private queryModelService: IQueryModelService,
@IThemeService themeService: IThemeService
) {
super();
this.resultsTab = this._register(new ResultsTab(instantiationService));
@@ -191,6 +194,8 @@ export class QueryResultsView extends Disposable {
this.qpTab = this._register(new QueryPlanTab());
this.topOperationsTab = this._register(new TopOperationsTab(instantiationService));
attachTabbedPanelStyler(this._panelView, themeService);
this._panelView.pushTab(this.resultsTab);
this._register(this._panelView.onTabChange(e => {
if (this.input) {