vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

Inserting open parenthesis in front of string literal adds closing parenthesis

Open just-ero opened this issue 5 months ago • 2 comments

Environment Data

VS Code version: 1.99.3 C# Extension version: 2.74.24

Steps to Reproduce

  1. Add the following code wherever syntactically applicable:
    var s = "";
    
  2. Insert an opening parenthesis in front of "".

Expected Behavior

The closing parenthesis should not be inserted.
This is indeed the behavior in Visual Studio today.

Actual Behavior

The closing parenthesis is inserted: var s = ()"";.

This does not happen when the opening parenthesis is inserted in front of other symbols, including number literals: var i = (0;.

just-ero avatar Apr 30 '25 12:04 just-ero