Kevin H.
Kevin H.

Reputation: 130

VS Code : How to fold C# xml comments?

I liked how Visual Studio 2017 had the ability to collapse XML documentation inside C# files:

[VS2017 Comment folding


However, I can't seem to get that capability in Visual Studio Code 1.9:

No folding


Is there a way to collapse XML comments in Visual Studio Code?

Upvotes: 1

Views: 1825

Answers (2)

j.raymond
j.raymond

Reputation: 1885

I found you can indent the comments in a manner similar to code.

/*
  Start (providing a visual reference, regions are not required)
     This is
     the collapsible
     region of comment
  */

For reference, the below will not create a collapsible comment.

/*
     This is
     the collapsible
     region of comment
  */

Upvotes: 0

Arslan Ameer
Arslan Ameer

Reputation: 1120

If you want to collapse at any certain point, just highlight and select the code you want to collapse, and use following keys to fold & unfold.

Shortcut Keys:

Fold (Ctrl+Shift+[ on Windows, ++[ on OS X) folds the innermost uncollapsed region at the cursor

Unfold (Ctrl+Shift+] on Windows, ++] on OS X) unfolds the collapsed region at the cursor

Fold All (Ctrl+K Ctrl+0 (zero) on Windows, +K +0 (zero) on OS X) folds all region in the editor

Unfold All (Ctrl+K Ctrl+J on Windows, +K +J on OS X) unfolds all regions in the editor

These are VS-Code Defaults.

Thank You , I Hope This Might Help.

Upvotes: 1

Related Questions