csharpier
csharpier copied to clipboard
Leading/trailing comments with binary expressions
Either way that we format binary expressions (break before or break after operator) we run into cases like this. In this situation, we should really be moving the operator to before the trailing comment. Or more likely, moving the trailing comment to the operator instead of the left (I think it would be left) side of the expression.
// original code
[InlineData(
"02" // (WRONG! - must be 0x01) Version
+ "705EEDCC7D42F1D6B3B98A593625BB4C" // SecurityToken
+ "01" // IsCookieToken
)]
// formatted code
[InlineData(
"02" // (WRONG! - must be 0x01) Version
+
"705EEDCC7D42F1D6B3B98A593625BB4C" // SecurityToken
+
"01" // IsCookieToken
)]
See InterpolatedStringExpressions.cst, one of those test cases may change.