Skip to content

Surrounding with brackets doesn’t work in some cases #225916

Closed

Description

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.93.0-insider (d751e43)
  • OS Version: macOS Sonoma 14.6.1

Surrounding selected text with brackets doesn’t work for some TypeScript/JavaScript arrow functions. VS Code Insiders 1.91 (June 2024) is the first release build where this stopped working.

Steps to Reproduce:

Important: Set editor to "Spaces: 2" tab mode (doesn't repro with Tabs)

  1. Create a JavaScript or TypeScript file with the following content:
const fn = () =>
  doSomething()
  1. Select doSomething().
  2. Type {, [, or (. VS Code should surround the selection with brackets, but the selected text is deleted and the opening bracket is inserted at the beginning of the line.

Expected result:

const fn = () =>
  {doSomething()}

Actual result:

const fn = () =>
{

Activity

  1. added
    editor-autoclosing
    on Aug 19, 2024
  2. added
    javascript
    on Aug 19, 2024
  3. added
    bug
    on Dec 13, 2024
  4. klaussner commented on Jan 5, 2025

    @klaussner
    ContributorAuthor

    I used git bisect to find the commit that caused the problem: 8ca1b8c

  5. dmitrivMS commented on Aug 29, 2026

    @dmitrivMS
    Collaborator

    This does not repro for me - it works as expected.
    Version: 1.136.0-insider (user setup)
    Commit: d5ceefb
    Date: 2026-08-28T16:34:03Z
    Electron: 42.10.0
    ElectronBuildId: 15109253
    Chromium: 148.0.7778.280
    Node.js: 24.18.1
    V8: 14.8.178.38-electron.0
    @github/copilot: 1.0.81-0
    @github/copilot-sdk: 1.0.11
    OS: Windows_NT x64 10.0.26200

  6. added
    unreleased
    on Aug 31, 2026
  7. added this to the 1.137.0 milestone on Aug 31, 2026
  8. added
    insiders-released
    and removed
    unreleased
    on Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugeditor-autoclosingeditor-autoindentinsiders-releasedjavascriptverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions