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

2

4

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

Discomposure answered 1/1, 2022 at 14:17 Comment(6)
Shouldn’t it not work if there are missing brackets? Why is it missing after selecting automatic completion of parentheses? Did you try to reset vs or restart vs?Odontoid
yes, I did it but it did not helpedDiscomposure
Please provide a minimal reproducible example here. What is Boo()?Odontoid
I could not reproduce your problem. Have you installed some smart reminder extensions?Odontoid
@JialeXue-MSFT i.imgur.com/vAm7idv.gifDiscomposure
@JialeXue-MSFT It does not depends on extensions. Now I have check on other computer where no extensions are installed, only Visual studio 2019. seems it is an old problemDiscomposure
L
2

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"

Lannie answered 6/6 at 5:51 Comment(0)
D
1

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

Discomposure answered 15/11, 2022 at 9:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.