If you’re a routine Visual Studio user like me, I don’t need to tell you how awesome Intellisense is. Not only would some of us be lost without it, but it also helps us be way more efficient programmers either through simple selection of methods or properties or by discovering new object members that maybe we didn’t know about previously. Additionally, one of the main benefits of Intellisense is that it tells you about the item in question, for instance, that the String.IsNullOrEmpty() function “Indicates whether the specified System.String object is null or an System.String.Empty string.”
When writing my own objects, however, I used to find myself yearning for this kind of help for my own functions. Wouldn’t it be great to get Intellisense to tell me what that “GetUserInfo” function I wrote five weeks ago does rather than me having to go look it up? What about what those parameter names mean? Luckily, there is a way, and it is super easy.
For example, let’s say you have an object that returns its own permalink in a shared function called
GetHTMLPermaLink(). To document it, simply place your cursor above the function and press the apostrophe key three times:
'''. Automagically, the following pops up:
All you have to do is fill in the blanks and viola, you have documented code! (NOTE: in C#, I believe the syntax is
/// but I’m not sure.) To see this in action, after you fill in the appropriate information, go try to pull up your function somewhere and watch the magic:
More information on Visual Studio Code Documentation (C#)