I know using /// to comment a function is the right way, and it also works for properties as shown by the following code
/// <summary>
/// This is for demo
/// </summary>
public class Foo
{
/// <summary>
/// Description A (working for intellisense)
/// </summary>
public int iA { get; set; }
/// Description B (not working for intellisense)
public int iB { get; set; }
public int iC { get; set; }
}
I am wondering if there is a simpler way to comment class properties for intellisense than the /// which is 3 lines minimum.
Single-line comments start with two forward slashes ( // ). Any text between // and the end of the line is ignored by C# (will not be executed).
Type /// in C#, or ''' in Visual Basic. From the Edit menu, choose IntelliSense > Insert Comment.
The suggestion list of Basic completion appears when you press the default Visual Studio IntelliSense shortcut Ctrl+Space . If necessary, you can always return to the Visual Studio's native's IntelliSense. To do so, select Visual Studio on the Environment | IntelliSense | General page of ReSharper options ( Alt+R, O ).
You can trigger IntelliSense in any editor window by typing Ctrl+Space or by typing a trigger character (such as the dot character (.) in JavaScript). Tip: The suggestions widget supports CamelCase filtering, meaning you can type the letters which are upper cased in a method name to limit the suggestions.
It's just XML. You can do it in one line if you want to.
/// <summary>Description A (working for intellisense)</summary>
public int iA { get; set; }
You can you GhostDoc which generates some simple but useful comments automatically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With