From 5f48e4a28d4f1a0aeb217fdc1caa1fab3945f2a8 Mon Sep 17 00:00:00 2001 From: Lewis Sanchez <87730006+lewis-sanchez@users.noreply.github.com> Date: Fri, 6 May 2022 14:14:47 -0700 Subject: [PATCH] Adds hot key combination for finding nodes in execution plans. (#19303) * Adds hot key combination for finding nodes in execution plans. * Captures cmd + f key combinations for other platforms * Stops event propagation when targeted hot key sequence is pressed --- .../executionPlan/browser/executionPlanView.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/sql/workbench/contrib/executionPlan/browser/executionPlanView.ts b/src/sql/workbench/contrib/executionPlan/browser/executionPlanView.ts index 99bbc548fd..d2e3d97b03 100644 --- a/src/sql/workbench/contrib/executionPlan/browser/executionPlanView.ts +++ b/src/sql/workbench/contrib/executionPlan/browser/executionPlanView.ts @@ -195,6 +195,15 @@ export class ExecutionPlanView implements ISashLayoutProvider { }); } }; + + this._container.onkeydown = (e: KeyboardEvent) => { + if ((e.ctrlKey || e.metaKey) && e.key === 'f') { + let searchNodeAction = self._instantiationService.createInstance(SearchNodeAction, 'HotKey'); + searchNodeAction.run(self); + + e.stopPropagation(); + } + }; } getHorizontalSashTop(sash: Sash): number { @@ -271,7 +280,7 @@ export class ExecutionPlanView implements ISashLayoutProvider { } } -type ExecutionPlanActionSource = 'ContextMenu' | 'ActionBar'; +type ExecutionPlanActionSource = 'ContextMenu' | 'ActionBar' | 'HotKey'; export class OpenQueryAction extends Action { public static ID = 'ep.OpenQueryAction';