Skip to content

Code viewer: Highlight All Occurrences of Selected Text #2518

Description

@PhilippDehner

Currently, when a user selects a piece of text (like a variable, function name, or any string), there is no visual feedback on where else that same text appears in the current file. This makes it more difficult and time-consuming to track the usage of variables, find all instances of a specific string, or quickly spot potential typos. The current alternative is to use the find function (Ctrl+F), which is less efficient and disrupts the development workflow.

I would like to propose a feature that automatically highlights all occurrences of a selected piece of text within the active editor view. This is a standard feature in many modern code editors and IDEs (e.g., VS Code, Sublime Text, JetBrains IDEs) and significantly improves productivity.

Expected Behavior:

  1. A user selects a word or a string of characters.
  2. Instantly, all other identical strings in the currently open document are highlighted with a distinct but subtle style (e.g., a different background color or an outline).
  3. When the user deselects the text (e.g., by clicking elsewhere), the highlighting disappears.

Example in VS2026:
Image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions