Reputation: 23
Hi, I have these settings for comments in Visual Studio 2017:
1) two comment bars '//' (dark green in the image) to indicate 'normal comments'.
2) three comment bars '///' (light green) for special notes and titles.
I find this technique very useful to mantain a clearer code, and I would like to apply the same logic (having similar color settings) in Visual Studio Code.
But I can't figure it out how to do it.
Upvotes: 1
Views: 2566
Reputation: 5306
You can change the comment color by going to:
Tools | Options | Environment | Fonts and Colors | Comment
Upvotes: 0
Reputation: 3634
No. You got it wrong. Tripple slash comment is for documentation generation. It is NOT meant for coloring. When it is used with the proper tags, the compiler autogenerates the relative documentation/tooltips:
<summary>Open the connection.</summary>
public void Open()
{
.
.
.
}
Later, when one is accessing the Open()
method in Visual Studio, in addition to the intellisense, a tooltip is shown, with the text "Opens the connection."
AFAIK, there is no such thing as a "coloring of a comment". Nor there are "different comments". What do you mean by that?
If you're looking for a way to order your commenes, you might find useful, to structurize them by using a "comment token", thus making the comment appear on the Visual Studio's Task List. Also, you can create your own tokens. From the menu, open the Tools -> Options dialog; choose Environment => Task List from the list on the left.
So somewhere in you code you might do this:
// TODO: Either delete or uncomment the next line.
// settings.decorared = false
Then you'll see the TODO note in your Task List, but not the //settings.decorated
.
Hint: To display the Task List press Ctrl+\,T.
Upvotes: 1