Skip to content

The pattern book

Comments

dress_line_comment_spacing = single

Controls comment-adjacent trivia. Comment text remains unchanged except for configured delimiter spacing.

  • Values: none single
  • Default: single
  • Applies to: Comment-adjacent trivia.
  • Guarantee: Comment text remains unchanged except for configured delimiter spacing.
Input
/// <summary>Formats this example.</summary>
class Example // attached comment
{
/*block comment*/
}

Code unchanged.

dress_block_comment_spacing = single

Controls comment-adjacent trivia. Comment text remains unchanged except for configured delimiter spacing.

  • Values: none single
  • Default: single
  • Applies to: Comment-adjacent trivia.
  • Guarantee: Comment text remains unchanged except for configured delimiter spacing.
Input
/// <summary>Formats this example.</summary>
class Example // attached comment
{
/*block comment*/
}
/// <summary>Formats this example.</summary>
class Example // attached comment
{
/*block comment*/
/* block comment */
}
dress_attached_comment_placement = auto

Controls comment-adjacent trivia. Comment text remains unchanged except for configured delimiter spacing.

  • Values: same_line own_line auto
  • Default: auto
  • Applies to: Comment-adjacent trivia.
  • Guarantee: Comment text remains unchanged except for configured delimiter spacing.
Input
/// <summary>Formats this example.</summary>
class Example // attached comment
{
/*block comment*/
}

Code unchanged.

dress_comment_align = true

Aligns 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: true false
  • Default: true
  • Applies to: The indentation of a comment on its own line.
  • Guarantee: Only indentation whitespace changes.
Input
class Example
{
void Work()
{
// Explains the call below.
Call();
}
}
class Example
{
void Work()
{
// Explains the call below.
// Explains the call below.
Call();
}
}
dress_xml_comment_placement = attached

Controls comment-adjacent trivia. Comment text remains unchanged except for configured delimiter spacing.

  • Values: attached separated
  • Default: attached
  • Applies to: Comment-adjacent trivia.
  • Guarantee: Comment text remains unchanged except for configured delimiter spacing.
Input
/// <summary>Formats this example.</summary>
class Example // attached comment
{
/*block comment*/
}

Code unchanged.

dress_xml_element_layout = unset

Controls comment-adjacent trivia. Comment text remains unchanged except for configured delimiter spacing.

  • Values: single_line multi_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.
Input
/// <summary>Formats this example.</summary>
class Example // attached comment
{
/*block comment*/
}

Code unchanged.