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
Tested with 0.24.2, this can be reproduced in the playground:
// InputpublicclassC{publicvoidTest(){this// This is a comment .LongUglyMethod();}}// Playground output// Observe that the comment and .LongUglyMethod() are not indentedpublicclassC{publicvoidTest(){this// This is a comment.LongUglyMethod();}}// Expected outputpublicclassC{publicvoidTest(){this// This is a comment.LongUglyMethod();}}
This seems to only occur if the first line is a comment.
If the comment line follows an already indented line, everything seems ok:
// InputpublicclassC{publicvoidTest(){
services
.A()// This is a comment .C();}}// Output is okpublicclassC{publicvoidTest(){
services
.A()// This is a comment.C();}}
The text was updated successfully, but these errors were encountered:
Here's another bad case I observed involving comments messing subsequent formatting.
When you put a comment on a method parameter that has an attribute, the comment forces a line break between attribute and parameter name. This is inconsistent with the formatting without comment, and doesn't look good on short lines.
// Input and expected -> ok!voidTestALongMethodWithAttributesOnParameter([FromBody]stringname,[FromQuery]List<string>manyTags){}// Input and expected -> not okvoidTestALongMethodWithAttributesOnParameterAndComment(// This is a comment on name[FromBody]stringname,[FromQuery]List<string>manyTags){}// Actual playground output for 2nd methodvoidTestALongMethodWithAttributesOnParameterAndComment(// This is a comment on name[FromBody]stringname,[FromQuery]List<string>manyTags){}
Tested with 0.24.2, this can be reproduced in the playground:
This seems to only occur if the first line is a comment.
If the comment line follows an already indented line, everything seems ok:
The text was updated successfully, but these errors were encountered: