codecadwallader / codemaid

CodeMaid is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding.
http://www.codemaid.net
GNU Lesser General Public License v3.0
1.88k stars 352 forks source link

XML Comment formatting eats spacing inside `<code>` block #1039

Open RenderMichael opened 4 months ago

RenderMichael commented 4 months ago

Environment

Description

/// <summary>
/// Represents an HTML element.
/// </summary>
/// <remarks>
/// Use this like the following:
/// <code>
/// new Element()
/// {
///     Locator = ...,
///     LocatorType = ...,
///     Name = ...,
///     Type = ...
/// }
/// </code>
/// </remarks>
public sealed record Element
{
  // ..
}

Steps to recreate

  1. Take the above text and format it

Current behavior

/// <summary>
/// Represents an HTML element.
/// </summary>
/// <remarks>
/// Use this like the following:
/// <code>
///new Element()
///{
///Locator = ...,
///LocatorType = ...,
///Name = ...,
///Type = ...
///}
/// </code>
/// </remarks>
public sealed record Element
{
  // ..
}

This triggers SA1004 as well as making the output un-formatted.

Expected behavior

Formatting inside a code block is kept.

RenderMichael commented 4 months ago

I fidgeted with the settings and couldn't find one to turn this off, so for now I turned off format-on-save for comments completely.