Skip to content

Conversation

@dmitrivMS
Copy link
Contributor

@dmitrivMS dmitrivMS commented Dec 29, 2025

Fixes #9123

Enables selection of brackets/string contents by double-clicking next to bracket/quote inside.

Does not include any of the following:

  • Support for interpolated or multi-line strings
  • Support for comments
  • Support for regex literals
  • Command or key-binding for such functionality

I considered adding a setting to turn this off, but decided against it for now because double-clicking in such locations seem to do nothing particularly useful today.

Copilot AI review requested due to automatic review settings December 29, 2025 10:12
@dmitrivMS dmitrivMS added the editor-bracket-matching Editor brace matching label Dec 29, 2025
@dmitrivMS dmitrivMS requested a review from hediet December 29, 2025 10:12
@dmitrivMS dmitrivMS self-assigned this Dec 29, 2025
@dmitrivMS dmitrivMS enabled auto-merge December 29, 2025 10:12
@vs-code-engineering vs-code-engineering bot added this to the December / January 2026 milestone Dec 29, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enables selection of content inside brackets or strings by double-clicking next to the opening or closing delimiter. The feature integrates into the existing double-click word selection behavior in the editor.

Key Changes:

  • Added _trySelectBracketContent and _trySelectStringContent methods to ViewController to detect and select content when double-clicking adjacent to delimiters
  • Modified the double-click handler in dispatchMouse to attempt bracket/string content selection before falling back to word selection
  • Added helper method _select to apply selections via core commands

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/vs/editor/browser/view/viewController.ts Implements the core logic for detecting double-clicks near brackets/quotes and selecting the content inside; integrates with existing mouse dispatch handling
src/vs/editor/contrib/bracketMatching/test/browser/bracketMatching.test.ts Adds tests for bracket content selection, though the tests manually simulate the expected behavior rather than testing the actual feature implementation

@dmitrivMS dmitrivMS modified the milestones: December 2025, January 2026 Jan 6, 2026
@dmitrivMS dmitrivMS disabled auto-merge January 9, 2026 09:03
@dmitrivMS dmitrivMS enabled auto-merge (squash) January 9, 2026 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

editor-bracket-matching Editor brace matching

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Double click after curly brace to select the content

2 participants