Search code examples
c#visual-studioidevisual-studio-2022

Visual Studio IDE 2022 (C#) - Auto-complete of parentheses is broken


I'm using Visual Studio IDE 2022, Parentheses completion is not working correctly. For example, I want to write:

Foo(Boo());

but result is:

Foo(Boo(); - one brace is missing.

enter image description here

I have checked and unchecked "Automatic brace completion" but it does not help.

By the way VSCode does this job correctly:

enter image description here

If you want this problem to be solved please vote here: Autocompleteofparenthesesisbroken


Solution

  • This extension fixes the problem:

    Auto Close & Surround Punctuations

    To avoid errors, be sure to disable the default behavior of Visual Studio. Go to "Menu > Tools > Options", find these options and uncheck the box:

    "Automatic brace completion"

    and

    "Automatically surround selection when typing quotes or brackets"