C# XML Comments in Visual Studio Code

Comments 0

Share to social media

Visual Studio Code appeared years ago as a light option to the full Visual Studio Environment. Being light, there are some features that we don’t have or at least took some time to appear. C# XML Comments is one of them.

If a code needs to be full of comments, it’s possible the code is not good enough to be read. However, this doesn’t mean we should totally avoid comments. Some explanations on business logic may be useful. If we manage to include these explanations in a standard format that could even be extracted later, even better.

In the past there was an extension for C# XML Comments but since version 1.23.8 the C# XML comments are naively support on Visual Studio Code, but not enabled by default.

In order to enable them, we need to enable the configuration Format On Type on File->Preferences->Settings->Text Editor->Formatting

Basically, we are telling the editor to format our code, in this case the XML Comments, immediately after typing.

 

 

I confess I don’t know for sure what other formatting features are included when we enable this option but I would love to discover this. If you find this out, drop a comment on this blog.

Load comments

About the author

Dennes Torres

See Profile

Dennes Torres is a Data Platform MVP and Software Architect living in Malta who loves SQL Server and software development and has more than 20 years of experience. Dennes can improve Data Platform Architectures and transform data in knowledge. He moved to Malta after more than 10 years leading devSQL PASS Chapter in Rio de Janeiro and now is a member of the leadership team of MMDPUG PASS Chapter in Malta organizing meetings, events, and webcasts about SQL Server. He is an MCT, MCSE in Data Platforms and BI, with more titles in software development. You can get in touch on his blog https://dennestorres.com or at his work https://dtowersoftware.com