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

@@ -206,6 +206,27 @@ export class CopyQueryWithResultsKeyboardAction extends Action {
}
}
export class EstimatedExecutionPlanKeyboardAction extends Action {
public static ID = 'estimatedExecutionPlanKeyboardAction';
public static LABEL = nls.localize('estimatedExecutionPlanKeyboardAction', "Display Estimated Execution Plan");
constructor(
id: string,
label: string,
@IEditorService private _editorService: IEditorService
) {
super(id, label);
this.enabled = true;
}
public override async run(): Promise<void> {
const editor = this._editorService.activeEditorPane;
if (editor instanceof QueryEditor) {
editor.input.runQuery(editor.getSelection(), { displayEstimatedQueryPlan: true });
}
}
}
export class RunCurrentQueryWithActualPlanKeyboardAction extends Action {
public static ID = 'runCurrentQueryWithActualPlanKeyboardAction';
public static LABEL = nls.localize('runCurrentQueryWithActualPlanKeyboardAction', "Run Current Query with Actual Plan");