Commit 48ef9cb
Add "%%" to noBreakInfixOps to fix soundness bug with custom %% operator
The custom %% operator (and the built-in F# quotation splice operators %%
and %%) can be interpreted by the F# parser as unary prefix operators when
they appear at the start of a new line. This caused Fantomas to produce
invalid F# code by placing the operator on a new line.
The fix adds "%%" to the noBreakInfixOps set, which keeps the operator on
the same line as its left-hand-side expression (with the right-hand-side
indented below if needed), matching the existing behaviour for %, =, <, >.
Fixes #2107
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 9e8ba5d commit 48ef9cb
File tree
2 files changed
+24
-1
lines changed- src
- Fantomas.Core.Tests
- Fantomas.Core
2 files changed
+24
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
496 | 519 | | |
497 | 520 | | |
498 | 521 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
0 commit comments