mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -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 style() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public set input(input: QueryResultsInput) {
|
private setQueryRunner(runner: QueryRunner) {
|
||||||
this._input = input;
|
this.resultsTab.queryRunner = runner;
|
||||||
dispose(this.runnerDisposables);
|
this.chartTab.queryRunner = runner;
|
||||||
this.runnerDisposables = [];
|
this.runnerDisposables.push(runner.onQueryStart(e => {
|
||||||
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 => {
|
|
||||||
this.hideChart();
|
this.hideChart();
|
||||||
this.hidePlan();
|
this.hidePlan();
|
||||||
this.input.state.visibleTabs = new Set();
|
this.input.state.visibleTabs = new Set();
|
||||||
@@ -232,9 +224,9 @@ export class QueryResultsView extends Disposable {
|
|||||||
this._panelView.pushTab(this.topOperationsTab);
|
this._panelView.pushTab(this.topOperationsTab);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.runnerDisposables.push(queryRunner.onQueryEnd(() => {
|
this.runnerDisposables.push(runner.onQueryEnd(() => {
|
||||||
if (queryRunner.isQueryPlan) {
|
if (runner.isQueryPlan) {
|
||||||
queryRunner.planXml.then(e => {
|
runner.planXml.then(e => {
|
||||||
this.showPlan(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() {
|
clearInput() {
|
||||||
this._input = undefined;
|
this._input = undefined;
|
||||||
this.resultsTab.clear();
|
this.resultsTab.clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user