Tim
Tim

Reputation: 11

Visual Studio 2022 C# intellicode not adding closing braces

I'm not sure if it's a bug or under-developed but my Visual Studio 2022 Intellicode does not automatically add closing braces (both on suggestion & format on save).

enter image description here

enter image description here

I do have Automatic brace completion enabled in the options but this does not solve the current issue.

Is there a way to fix this?

Upvotes: 1

Views: 138

Answers (1)

Minxin Yu - MSFT
Minxin Yu - MSFT

Reputation: 4247

This issue is currently being investigated by Developer Community.

You haven't completed the code after {, for example:

 int[] array = new int[] { 5 };

for (int i = 0; i < array.Length; i++) {

Then input console. It will complete the brace.

enter image description here

Error report: There are issues with Intellicode in VS2022, you can follow this thread and post your comments to get Microsoft's attention.

IntelliCode Suggestion Issue: Block Code Not Closed Automatically

Upvotes: 1

Related Questions