Skip to content

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

Open

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:

  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 = () =>
{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Labels

editor-autoclosingEditor automatic closing of parens / brackets / etc.javascriptJavaScript support issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions