Skip to content

feat: add Go to Result and Open Result to Side commands for search editor#306567

Open
yogeshwaran-c wants to merge 1 commit intomicrosoft:mainfrom
yogeshwaran-c:feat/search-editor-go-to-result-keybinding
Open

feat: add Go to Result and Open Result to Side commands for search editor#306567
yogeshwaran-c wants to merge 1 commit intomicrosoft:mainfrom
yogeshwaran-c:feat/search-editor-go-to-result-keybinding

Conversation

@yogeshwaran-c
Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Feature — adds two new commands to the Search Editor

What is the current behavior?

In the Search Editor, navigating to a search result can only be done via:

  • Double-clicking (configurable via search.searchEditor.doubleClickBehaviour)
  • F12 (Go to Definition) / Ctrl+K F12 (Open Definition to Side)

There are no dedicated Search Editor commands for "go to result" or "open result to the side" that users can discover via the Command Palette or bind to custom keybindings.

Closes #194044

What is the new behavior?

Two new commands are added:

  • Search Editor: Go to Result (searchEditor.action.goToResult) — navigates to the result at the cursor position in the active editor group
  • Search Editor: Open Result to the Side (searchEditor.action.openResultToSide) — opens the result in an editor group to the side

Both commands:

  • Are available in the Command Palette when a Search Editor is active
  • Can be assigned custom keybindings by users
  • Handle both result lines (go to declaration / open to side) and file header lines (peek definition)

The existing double-click handler has been refactored to share the same openResult() helper method, reducing code duplication.

Additional context

Implementation follows the approach suggested by @andreamah in the issue comment: abstracting the double-click logic into a reusable method and exposing it as search editor actions.

No default keybindings are assigned to avoid conflicts with the editor's text editing shortcuts — users can configure their preferred bindings (e.g., Enter / Cmd+Enter) through the Keyboard Shortcuts editor.

…itor

Add two new commands (searchEditor.action.goToResult and
searchEditor.action.openResultToSide) that allow navigating to search
results from the keyboard, matching the double-click behavior. The
existing double-click handler is refactored to share the new openResult
helper method.

Both commands are available via the Command Palette when a Search Editor
is active, and users can assign custom keybindings.

Closes microsoft#194044
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search Editor: Add keybinding for double-click action, e.g. to open to the side

2 participants