Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 313
DevMis Avatar asked Oct 26 '25 10:10

DevMis


2 Answers

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"

like image 199
Bachi Avatar answered Oct 28 '25 23:10

Bachi


Seems it is an old problem because the same problem was with C++. I think for C++ the problem was solved but C# was forgotten.

If you want this problem to be solved for C# in Visual Studio IDE please vote here: Autocompleteofparenthesesisbroken

like image 36
DevMis Avatar answered Oct 29 '25 01:10

DevMis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!