roslyn
roslyn copied to clipboard
Style: Decrease number of lines for default <summary> element in XML comments
Version Used: Visual Studio 2015
Steps to Reproduce:
- Open a code file.
- Type three slashes to start an xml comment
Expected Behavior:
/// <summary>|</summary>
Actual Behavior:
/// <summary>
/// |
/// </summary>
I would prefer it, if the default behavior when creating xml documents would create 1 line instead of 3 lines.
The reasons being:
- It would cut down the size of single line comments by 2/3, which is a 66% saving.
- Single line comments are a major use case as they are fairly common, e.g. for properties, most simple methods.
- Even in the case that you want a multi-line comment you can simply hit enter like you already do.
- Consistent with other xml documentation elements, e.g. 'returns' or 'params'
Take care, Martin
In this style:
/// <summary>
/// |
/// </summary>
-- description better striking. Furthermore, for the properties as the default template to insert I:
/// <summary>
///
/// </summary>
/// <value>
///
/// </value>
-- and let the user decide to remove an optional attribute
Given the discussion and reactions to this issue, we wouldn't make a blanket change like this. Instead, I think two possible approaches are:
- Add an option controlling the behavior (but keep the current behavior the default).
- Use snippets that the user can edit to define what gets inserted for
///.
@Pilchie 1.Add an option controlling the behavior (but keep the current behavior the default). - very good yield!
I prefer the second approach, if snippets are candidates for Roslyn then the ability to define/implement what the XML snippets do sounds like a good feature-baseline. (and it does not rule out an implementation that offers such option)
I agree the first approach is much easier to ship though.
We would take this, as long as 'enter' puts things back in the original form.