microsoft / microsoft/vscode

Go to File (Ctrl+P): pre-fill filter with editor selection (JetBrains-style)

Open
#332,744 0 comments 0 reactions 1 assignee Claimed by @TylerLeonhardt View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

### Description

JetBrains IDEs pre-fill the "Go to File" filter with the current editor selection.

VS Code doesn't do this for Go to File (`Ctrl+P`) today, even though it already does something similar for **Find in Files** (`Ctrl+Shift+F`) and **Go to Symbol** (`Ctrl+T`).

### Proposed behavior

When there is an explicit, non-empty text selection in the active editor and the user presses `Ctrl+P`, Go to File should pre-fill its filter field with that selection.

Should **not** trigger on word-at-cursor (no selection) to avoid surprising, noisy filters — this should be selection-only, independent of the `editor.find.seedSearchStringFromSelection` setting.

### Demo

Image

### Implementation

Already implemented in #330538, using the existing `getSelectionSearchString` helper (the same utility Go to Symbol uses).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.