mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-24 17:23:05 -05:00
check for undefined on query info (#3933)
This commit is contained in:
committed by
Karl Burtram
parent
8fa247145e
commit
a2d6955f79
@@ -200,18 +200,10 @@ export class QueryResultsView extends Disposable {
|
||||
public style() {
|
||||
}
|
||||
|
||||
public set input(input: QueryResultsInput) {
|
||||
this._input = input;
|
||||
dispose(this.runnerDisposables);
|
||||
this.runnerDisposables = [];
|
||||
this.resultsTab.view.state = this.input.state;
|
||||
this.qpTab.view.state = this.input.state.queryPlanState;
|
||||
this.topOperationsTab.view.state = this.input.state.topOperationsState;
|
||||
this.chartTab.view.state = this.input.state.chartState;
|
||||
let queryRunner = this.queryModelService._getQueryInfo(input.uri).queryRunner;
|
||||
this.resultsTab.queryRunner = queryRunner;
|
||||
this.chartTab.queryRunner = queryRunner;
|
||||
this.runnerDisposables.push(queryRunner.onQueryStart(e => {
|
||||
private setQueryRunner(runner: QueryRunner) {
|
||||
this.resultsTab.queryRunner = runner;
|
||||
this.chartTab.queryRunner = runner;
|
||||
this.runnerDisposables.push(runner.onQueryStart(e => {
|
||||
this.hideChart();
|
||||
this.hidePlan();
|
||||
this.input.state.visibleTabs = new Set();
|
||||
@@ -232,9 +224,9 @@ export class QueryResultsView extends Disposable {
|
||||
this._panelView.pushTab(this.topOperationsTab);
|
||||
}
|
||||
}
|
||||
this.runnerDisposables.push(queryRunner.onQueryEnd(() => {
|
||||
if (queryRunner.isQueryPlan) {
|
||||
queryRunner.planXml.then(e => {
|
||||
this.runnerDisposables.push(runner.onQueryEnd(() => {
|
||||
if (runner.isQueryPlan) {
|
||||
runner.planXml.then(e => {
|
||||
this.showPlan(e);
|
||||
});
|
||||
}
|
||||
@@ -244,6 +236,29 @@ export class QueryResultsView extends Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
public set input(input: QueryResultsInput) {
|
||||
this._input = input;
|
||||
dispose(this.runnerDisposables);
|
||||
this.runnerDisposables = [];
|
||||
this.resultsTab.view.state = this.input.state;
|
||||
this.qpTab.view.state = this.input.state.queryPlanState;
|
||||
this.topOperationsTab.view.state = this.input.state.topOperationsState;
|
||||
this.chartTab.view.state = this.input.state.chartState;
|
||||
|
||||
let info = this.queryModelService._getQueryInfo(input.uri);
|
||||
if (info) {
|
||||
this.setQueryRunner(info.queryRunner);
|
||||
} else {
|
||||
let disposeable = this.queryModelService.onRunQueryStart(c => {
|
||||
if (c === input.uri) {
|
||||
let info = this.queryModelService._getQueryInfo(input.uri);
|
||||
this.setQueryRunner(info.queryRunner);
|
||||
disposeable.dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
clearInput() {
|
||||
this._input = undefined;
|
||||
this.resultsTab.clear();
|
||||
|
||||
Reference in New Issue
Block a user