You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Product and Version Used:
VS extension Roslynator 2022 v4.12.5
Steps to Reproduce:
Enable RCS1181 in your .editorconfig file (disabled by default).
Make sure the containing project is configured to generate documentation files:
Open project Properties.
Go to page Build -> Output
Generate a file containing API documentation
Open a C# file and add a comment after a property. The comment must contain at least 1 < or &.
Actual Behavior:
namespaceMyNamespace{/// <summary>/// .../// </summary>publicclassClass1{internalintMyProperty{get;set;}// Must be >= 0 & <= 5. <-- RCS1181: Convert comment to documentation comment}}
Applying code fix produces this:
namespaceMyNamespace{/// <summary>/// .../// </summary>publicclassClass1{/// <summary>/// Must be >= 0 & <= 5. <-- CS1570 is reported 3 times here!/// </summary>internalintMyProperty{get;set;}}}
In this example, compiler errors are:
CS1570: XML comment has badly formed XML -- 'Whitespace is not allowed at this location.'
CS1570: XML comment has badly formed XML -- 'An identifier was expected.'
CS1570: XML comment has badly formed XML -- 'The character(s) '=' cannot be used at this location.'
Expected Behavior:
namespaceMyNamespace{/// <summary>/// .../// </summary>publicclassClass1{/// <summary>/// Must be >= 0 & <= 5./// </summary>internalintMyProperty{get;set;}}}
Note that encoding other XML special chars (>, " and ') is not required (at least for Visual Studio 2022) and doing so would produce source XML comments that are more complex to read (for developers) than needed.
Bottom line: RCS1181 should replace < with < and & with & (but IMHO leave >, " and ' unchanged).
The text was updated successfully, but these errors were encountered:
Product and Version Used:
VS extension Roslynator 2022 v4.12.5
Steps to Reproduce:
RCS1181
in your.editorconfig
file (disabled by default).<
or&
.Actual Behavior:
Applying code fix produces this:
In this example, compiler errors are:
Expected Behavior:
Note that encoding other XML special chars (
>
,"
and'
) is not required (at least for Visual Studio 2022) and doing so would produce source XML comments that are more complex to read (for developers) than needed.Bottom line:
RCS1181
should replace<
with<
and&
with&
(but IMHO leave>
,"
and'
unchanged).The text was updated successfully, but these errors were encountered: