How to change the VSCode SmartSelect interaction with quotation marks

Summary

The recent behavior change in VSCode’s SmartSelect now includes quotation marks when expanding selections using editor.action.smartSelect.expand. This affects users relying on precise selection behavior, particularly those using keyboard shortcuts or extensions that depend on the previous exclusion of quotation marks.

Root Cause

The root cause is a change in VSCode’s selection algorithm, likely introduced in a recent update. The algorithm now treats quotation marks as part of the selection scope, whereas previously they were excluded.

Why This Happens in Real Systems

  • Algorithm Updates: Editor behavior changes often stem from updates to core algorithms, which may prioritize new use cases over legacy ones.
  • Unintended Side Effects: Changes in one area (e.g., selection logic) can inadvertently impact unrelated workflows (e.g., extensions or shortcuts).

Real-World Impact

  • Broken Workflows: Users relying on precise selection behavior (e.g., in extensions or shortcuts) experience disruptions.
  • Reduced Productivity: Manual adjustments are required to exclude quotation marks, slowing down tasks.

Example or Code (if necessary and relevant)

// Current workaround: Custom keybinding to exclude quotes
{
  "key": "ctrl+shift+right",
  "command": "extension.customSmartSelect",
  "when": "editorTextFocus"
}

How Senior Engineers Fix It

  1. Identify the Change: Trace the behavior change to the specific VSCode release or PR using the changelog or Git history.
  2. Workaround: Create a custom extension or keybinding to replicate the old behavior.
  3. Report the Issue: File a detailed bug report on the VSCode GitHub repository to request a fix or configuration option.

Why Juniors Miss It

  • Lack of Changelog Awareness: Juniors often overlook release notes, missing critical updates that impact their workflows.
  • Limited Debugging Skills: They may struggle to isolate the issue as a recent change rather than a local configuration error.
  • Overlooking Workarounds: Juniors might not consider creating custom solutions or extensions to address the issue.

Leave a Comment