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
{{ message }}
Repository navigation
SA1013 misfires for object initializer in interpolated string #3461
triggers "SA1013 Closing brace should be followed by a space", but adding space after the } doesn't look right and also triggers "SA1013 Closing brace should not be preceded by a space" and the description for SA1013 states
A closing brace should always be followed by a single space, unless it is the last character on the line, or unless it is followed by a closing parenthesis, a comma, or a semicolon.
Activity
BDisp commentedon Feb 22, 2022
I think the correct formatting is:
Timo-Weike commentedon Feb 22, 2022
I disagree, you would also not write
or
$"Something { x }"Also code like
$"{new object()}"does not trigger SA1013, but
triggers SA1009 and SA1013
BDisp commentedon Feb 22, 2022
I would write:
if I want the space yes, otherwise;
$"Something{ x }"or
$"Something{x}"Inside a $"" is not mandatory, since you use the same rule on the left and on the right.
It must use the same rule on both side.
or
sharwell commentedon Feb 22, 2022
From the perspective of StyleCop Analyzers, the expected formatting here is:
Fix support for object initializers in interpolations