Commit fba7714
committed
Handle comments when indenting method chains
Previously, indentation went wrong when the comment on the line above
looked like a method call/member access:
fn main() {
// Lorem ipsum lorem ipsum lorem ipsum lorem.ipsum
foo.bar()
}
With this patch:
fn main() {
// Lorem ipsum lorem ipsum lorem ipsum lorem.ipsum
foo.bar()
}
Also, a blank line or a comment broke method-chain indentation:
fn main() {
something.a.do_it
// A comment
.aligned
.more_alignment();
}
With this patch:
fn main() {
something.a.do_it
// A comment
.aligned
.more_alignment();
}
Note that comments interleaving a method chain are not aligned with the
'.' of the method chain.1 parent 1587839 commit fba7714
2 files changed
+35
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1599 | 1599 | | |
1600 | 1600 | | |
1601 | 1601 | | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
1602 | 1615 | | |
1603 | 1616 | | |
1604 | 1617 | | |
| |||
1627 | 1640 | | |
1628 | 1641 | | |
1629 | 1642 | | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
1630 | 1654 | | |
1631 | 1655 | | |
1632 | 1656 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
304 | 315 | | |
305 | 316 | | |
306 | 317 | | |
| |||
0 commit comments