mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
fixed actual show plan command (#2620)
This commit is contained in:
committed by
Karl Burtram
parent
084042ad13
commit
a2fb0ec029
@@ -553,7 +553,10 @@ class GridTable<T> extends Disposable implements IView {
|
||||
private loadData(offset: number, count: number): Thenable<T[]> {
|
||||
return this.runner.getQueryRows(offset, count, this.resultSet.batchId, this.resultSet.id).then(response => {
|
||||
if (this.runner.isQueryPlan) {
|
||||
this.instantiationService.createInstance(ShowQueryPlanAction).run(response.resultSubset.rows[0][0].displayValue);
|
||||
// it's a show plan response
|
||||
if (response.resultSubset.rowCount === 1) {
|
||||
this.instantiationService.createInstance(ShowQueryPlanAction).run(response.resultSubset.rows[0][0].displayValue);
|
||||
}
|
||||
}
|
||||
return response.resultSubset.rows.map(r => {
|
||||
let dataWithSchema = {};
|
||||
|
||||
@@ -377,6 +377,26 @@ export class QueryEditor extends BaseEditor {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
public getAllSelection(): ISelectionData {
|
||||
if (this._sqlEditor && this._sqlEditor.getControl()) {
|
||||
let control = this._sqlEditor.getControl();
|
||||
let codeEditor: ICodeEditor = <ICodeEditor>control;
|
||||
if (codeEditor) {
|
||||
let model = codeEditor.getModel();
|
||||
let totalLines = model.getLineCount();
|
||||
let endColumn = model.getLineMaxColumn(totalLines);
|
||||
let selection: ISelectionData = {
|
||||
startLine: 0,
|
||||
startColumn: 0,
|
||||
endLine: totalLines - 1,
|
||||
endColumn: endColumn - 1,
|
||||
};
|
||||
return selection;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
public getSelectionText(): string {
|
||||
if (this._sqlEditor && this._sqlEditor.getControl()) {
|
||||
let control = this._sqlEditor.getControl();
|
||||
|
||||
Reference in New Issue
Block a user