The pattern book
Comments
Line comments
Section titled “Line comments”Line comment spacing
Section titled “Line comment spacing”dress_line_comment_spacing = singleControls comment-adjacent trivia. Comment text remains unchanged except for configured delimiter spacing.
- Values:
nonesingle - Default:
single - Applies to: Comment-adjacent trivia.
- Guarantee: Comment text remains unchanged except for configured delimiter spacing.
/// <summary>Formats this example.</summary>class Example // attached comment{ /*block comment*/}Code unchanged.
/// <summary>Formats this example.</summary>class Example // attached commentclass Example //attached comment{ /*block comment*/}Block comments
Section titled “Block comments”Block comment spacing
Section titled “Block comment spacing”dress_block_comment_spacing = singleControls comment-adjacent trivia. Comment text remains unchanged except for configured delimiter spacing.
- Values:
nonesingle - Default:
single - Applies to: Comment-adjacent trivia.
- Guarantee: Comment text remains unchanged except for configured delimiter spacing.
/// <summary>Formats this example.</summary>class Example // attached comment{ /*block comment*/}/// <summary>Formats this example.</summary>class Example // attached comment{ /*block comment*/ /* block comment */}Code unchanged.
Attached comment placement
Section titled “Attached comment placement”dress_attached_comment_placement = autoControls comment-adjacent trivia. Comment text remains unchanged except for configured delimiter spacing.
- Values:
same_lineown_lineauto - Default:
auto - Applies to: Comment-adjacent trivia.
- Guarantee: Comment text remains unchanged except for configured delimiter spacing.
/// <summary>Formats this example.</summary>class Example // attached comment{ /*block comment*/}Code unchanged.
/// <summary>Formats this example.</summary>class Example // attached comment{ /*block comment*/} /*block comment*/ }/// <summary>Formats this example.</summary>class Example // attached commentclass Example // attached comment{ /*block comment*/}Comment alignment
Section titled “Comment alignment”dress_comment_align = trueAligns a comment with the code it leads, giving it the indentation that code is given. When false a comment keeps the offset its author gave it and moves with that code instead. Comment text remains unchanged.
- Values:
truefalse - Default:
true - Applies to: The indentation of a comment on its own line.
- Guarantee: Only indentation whitespace changes.
class Example{ void Work() { // Explains the call below. Call(); }}class Example{ void Work() { // Explains the call below. // Explains the call below. Call(); }}Code unchanged.
XML documentation
Section titled “XML documentation”Xml comment placement
Section titled “Xml comment placement”dress_xml_comment_placement = attachedControls comment-adjacent trivia. Comment text remains unchanged except for configured delimiter spacing.
- Values:
attachedseparated - Default:
attached - Applies to: Comment-adjacent trivia.
- Guarantee: Comment text remains unchanged except for configured delimiter spacing.
/// <summary>Formats this example.</summary>class Example // attached comment{ /*block comment*/}Code unchanged.
/// <summary>Formats this example.</summary>
class Example // attached comment{ /*block comment*/}Xml element layout
Section titled “Xml element layout”dress_xml_element_layout = unsetControls comment-adjacent trivia. Comment text remains unchanged except for configured delimiter spacing.
- Values:
single_linemulti_line - Default:
unset(the rule makes no change unless you set it) - Applies to: Comment-adjacent trivia.
- Guarantee: Comment text remains unchanged except for configured delimiter spacing.
/// <summary>Formats this example.</summary>class Example // attached comment{ /*block comment*/}Code unchanged.
/// <summary>Formats this example.</summary>/// <summary>/// Formats this example./// </summary>class Example // attached comment{ /*block comment*/}