Dannon
Dannon

Reputation: 2216

Multi-line comment indentation formatting in Visual Studio 2019

In Visual Studio 2019, are there any settings to allow the configuration of the multi-line comments in order to always align new star characters (i.e.*)?

When inputting the first new line in a multi-line comment, a star (i.e. *) character is automatically generated and aligned with the backslash (i.e. \) character and not with the first star (i.e. *) character: enter image description here

It is really annoying to always have to manually fix this indentation issue. I have tried looking at the "Text Editor" formatting settings, however, there doesn't appear to be any settings for configuring multi-line comments. I also have been unsuccessfully searching around to see if there is an obvious fix.

Does anyone know how to make Visual Studio auto-align the star characters (i.e. *) in multi-line comments with the proceeding star characters?

Upvotes: 1

Views: 1389

Answers (2)

Dannon
Dannon

Reputation: 2216

Okay, I figured it out. @VRichardJP was exactly right - this formatting feature is for a Visual Studio extension to do. After trying a few, I found an extension that does exactly what I need and allows some flexibility: Doxygen Comments.

I am actually using Doxygen, so this extension is perfect for me, but even if you aren't, it still is really useful. The configuration is super straight forward and flexible (shown in the below picture). The extension options allow you to modify how the comments will look when auto-completed. enter image description here

With this extension, the auto-indentation works perfectly now: enter image description here

Upvotes: 1

VRichardJP
VRichardJP

Reputation: 167

I think you may have to use an extension for this feature. For example Auto Comment Blocks seems to do the job.

Upvotes: 0

Related Questions