Product and Version Used:
Roslynator.Analyzers
Steps to Reproduce:
set .editorconfig values:
roslynator_trailing_comma_style = omit_when_single_line
dotnet_diagnostic.RCS1260.severity = warning
Actual Behavior:
Warning RCS1260 on the , at the end of Property1
var value = new Object
{
Property1 = "Value"{|RCS1260:,|}
}
Expected Behavior:
No warning
var value = new Object
{
Property1 = "Value",
}
Possible correction:
I believe the following code relies solely on the initializer.Expressions syntax node, when it should be based on the initializer code.
|
&& expressions.IsSingleLine(cancellationToken: context.CancellationToken)) |
Other IsSingleLine() checks in this file need similar review.
Product and Version Used:
Roslynator.Analyzers
Steps to Reproduce:
set
.editorconfigvalues:Actual Behavior:
Warning RCS1260 on the
,at the end ofProperty1Expected Behavior:
No warning
Possible correction:
I believe the following code relies solely on the
initializer.Expressionssyntax node, when it should be based on theinitializercode.roslynator/src/Analyzers/CSharp/Analysis/AddOrRemoveTrailingCommaAnalyzer.cs
Line 67 in 7505ae8
Other
IsSingleLine()checks in this file need similar review.