Actual Execution Plan No Longer Executes Queries (#19840)

* Ctrl/Cmd + m, no longer executes queries.

* Adjusts command label

* Code review changes

* Uses category parameter to categorize actual plan command

* Actual execution plan command label matches estimated plan command label

* Revert "Actual execution plan command label matches estimated plan command label"

This reverts commit 15f301dfc64341d631ca5e9b1314d8cf739b2088.

* Centralizes localized category string (#19857)

* Actual Plan action uses centralized category
This commit is contained in:
Lewis Sanchez
2022-06-28 18:31:41 -07:00
committed by GitHub
parent a0c9a1fd3c
commit 96d29bcbc1
2 changed files with 13 additions and 9 deletions

View File

@@ -227,9 +227,9 @@ export class EstimatedExecutionPlanKeyboardAction extends Action {
}
}
export class RunCurrentQueryWithActualPlanKeyboardAction extends Action {
public static ID = 'runCurrentQueryWithActualPlanKeyboardAction';
public static LABEL = nls.localize('runCurrentQueryWithActualPlanKeyboardAction', "Run Current Query with Actual Plan");
export class ToggleActualPlanKeyboardAction extends Action {
public static ID = 'ToggleActualPlanKeyboardAction';
public static LABEL = nls.localize('ToggleActualPlanKeyboardAction', "Enable/Disable Actual Execution Plan");
constructor(
id: string,
@@ -242,9 +242,12 @@ export class RunCurrentQueryWithActualPlanKeyboardAction extends Action {
public override run(): Promise<void> {
const editor = this._editorService.activeEditorPane;
if (editor instanceof QueryEditor) {
editor.runCurrentQueryWithActualPlan();
let toActualPlanState = !editor.input.state.isActualExecutionPlanMode;
editor.input.state.isActualExecutionPlanMode = toActualPlanState;
}
return Promise.resolve(null);
}
}

View File

@@ -19,7 +19,7 @@ import { QueryResultsInput } from 'sql/workbench/common/editor/query/queryResult
import * as queryContext from 'sql/workbench/contrib/query/common/queryContext';
import {
RunQueryKeyboardAction, RunCurrentQueryKeyboardAction, CancelQueryKeyboardAction, RefreshIntellisenseKeyboardAction, ToggleQueryResultsKeyboardAction,
RunQueryShortcutAction, RunCurrentQueryWithActualPlanKeyboardAction, CopyQueryWithResultsKeyboardAction, FocusOnCurrentQueryKeyboardAction, ParseSyntaxAction, ToggleFocusBetweenQueryEditorAndResultsAction, EstimatedExecutionPlanKeyboardAction
RunQueryShortcutAction, ToggleActualPlanKeyboardAction, CopyQueryWithResultsKeyboardAction, FocusOnCurrentQueryKeyboardAction, ParseSyntaxAction, ToggleFocusBetweenQueryEditorAndResultsAction, EstimatedExecutionPlanKeyboardAction
} from 'sql/workbench/contrib/query/browser/keyboardQueryActions';
import * as gridActions from 'sql/workbench/contrib/editData/browser/gridActions';
import * as gridCommands from 'sql/workbench/contrib/editData/browser/gridCommands';
@@ -148,12 +148,13 @@ actionRegistry.registerWorkbenchAction(
actionRegistry.registerWorkbenchAction(
SyncActionDescriptor.create(
RunCurrentQueryWithActualPlanKeyboardAction,
RunCurrentQueryWithActualPlanKeyboardAction.ID,
RunCurrentQueryWithActualPlanKeyboardAction.LABEL,
ToggleActualPlanKeyboardAction,
ToggleActualPlanKeyboardAction.ID,
ToggleActualPlanKeyboardAction.LABEL,
{ primary: KeyMod.CtrlCmd | KeyCode.KEY_M }
),
RunCurrentQueryWithActualPlanKeyboardAction.LABEL
ToggleActualPlanKeyboardAction.LABEL,
CATEGORIES.ExecutionPlan.value
);
actionRegistry.registerWorkbenchAction(