Adds toggle button to switch between estimated and actual execution plans (#19629)

* Creates toggle button to switch between estimate and actual query plans

* Renames ID for the toggleActualExecutionPlanModeAction class

* Renames button back to explain

* Creating actual execution plans resembles SSMS

* Adds CTRL/CMD + L shortcut to display estimated execution plans

* Alphabetically organizes telemetry actions

* Adds telemetry when the setting for actual execution plan toggle is used

* Resolves build errors

* Fixes broken unit tests.

* Code review changes

* Removes unnecessary null-coalescing operator.

* Creates placeholder icons for actual execution plans enabled

* Code review changes

* Shortens label names

* Telemetry moved to toggle button

* Telemetry review changes

* Clarifies misleading label
This commit is contained in:
Lewis Sanchez
2022-06-09 16:07:12 -07:00
committed by GitHub
parent b1d8e43569
commit 20d2256709
12 changed files with 159 additions and 17 deletions

View File

@@ -41,6 +41,7 @@ export interface IQueryEditorStateChange {
executingChange?: boolean;
connectingChange?: boolean;
sqlCmdModeChanged?: boolean;
actualExecutionPlanModeChanged?: boolean;
}
export class QueryEditorState extends Disposable {
@@ -49,6 +50,7 @@ export class QueryEditorState extends Disposable {
private _resultsVisible = false;
private _executing = false;
private _connecting = false;
private _isActualExecutionPlanMode = false;
private _onChange = this._register(new Emitter<IQueryEditorStateChange>());
public onChange = this._onChange.event;
@@ -108,12 +110,24 @@ export class QueryEditorState extends Disposable {
return this._isSqlCmdMode;
}
public set isActualExecutionPlanMode(val: boolean) {
if (val !== this._isActualExecutionPlanMode) {
this._isActualExecutionPlanMode = val;
this._onChange.fire({ actualExecutionPlanModeChanged: true });
}
}
public get isActualExecutionPlanMode() {
return this._isActualExecutionPlanMode;
}
public setState(newState: QueryEditorState): void {
this.connected = newState.connected;
this.connecting = newState.connecting;
this.resultsVisible = newState.resultsVisible;
this.executing = newState.executing;
this.isSqlCmdMode = newState.isSqlCmdMode;
this.isActualExecutionPlanMode = newState.isActualExecutionPlanMode;
}
}