Description
I propose we ... add a feature that formats a statement into a line including comments that don't exceed the maximum width.
The existing way of Fantomas deals with this problem is ... When I format the code, the line of code including the comments sometimes exceeds the maximum width, but the line of code without comments doesn't exceed the maximum width.
Pros and Cons
The advantages of making this adjustment to Fantomas are ... Easier to read
The disadvantages of making this adjustment to Fantomas are ... None
Examples
Please provide multiple examples (before and after scenarios) and explain what rules did apply to achieve the outcome.
Input:
let complex_function first second third fourth last = first + second + third + fourth + last // complex function
Actual Output:
let complex_function first second third fourth last = first + second + third + fourth + last // complex function
Expected Output:
let complex_function first second third fourth last =
first + second + third + fourth + last // complex function
Input:
let very_complex_function first second third fourth fifth last = first + second + third + fourth + fifth + last // very complex function
Actual Output:
let very_complex_function first second third fourth fifth last =
first + second + third + fourth + fifth + last // very complex function
Expected Output:
let very_complex_function first second third fourth fifth last =
first + second + third + fourth + fifth + last // very complex function
Affidavit (please submit!)
Please tick this by placing a cross in the box:
- I have read the Contribution Guidelines.
- I have searched both open and closed suggestions on this site and believe this is not a duplicate
Please tick all that apply:
- This is not a breaking change to Fantomas
- I or my company would be willing to help implement and/or test this
- This suggestion is part of the Microsoft style guide (please add a link to section if so)
- This suggestion is part of the G-Research style guide (please add a link to section if so)
Activity