Commit 99efd73
authored
Permit ranges on multiple lines in closures, without an enclosing block (#4309)
The problem here was that if an expression in a closure fails to be
formatted without an enclosing block, as in the case of a multiline
range prior to this commit, we try to put the expression in the block.
But then we try to check what expressions should be "vetoed" from being
in a block, which includes ranges. The non-breaking fix is to let
multiline ranges be formatted without a block.
On the big picture, though, it may be the case that there is no need for
a "veto" check when formatting expressions in a closure block, or that
there is a better way to structure the work being done here. I added a
todo for this, since it's relatively low priority (IMO).
Closes #43081 parent 8e8db1f commit 99efd73
File tree
3 files changed
+27
-1
lines changed- src/formatting
- tests
- source
- target
3 files changed
+27
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
124 | 126 | | |
125 | 127 | | |
126 | 128 | | |
| |||
179 | 181 | | |
180 | 182 | | |
181 | 183 | | |
182 | | - | |
| 184 | + | |
| 185 | + | |
183 | 186 | | |
184 | 187 | | |
185 | 188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments