-
-
Notifications
You must be signed in to change notification settings - Fork 204
Adjust to optional lhs of SynMeasure.Divide #2925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- adjust to optional lhs of Measure.Divide
nojaf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far so good.
I think you can add some more tests where we now deal with trivia better.
src/Fantomas.Core/ASTTransformer.fs
Outdated
| | SynRationalConst.Integer i -> string i | ||
| | SynRationalConst.Rational(numerator, denominator, _) -> $"(%i{numerator}/%i{denominator})" | ||
| | SynRationalConst.Negate innerRc -> $"-{visit innerRc}" | ||
| | SynRationalConst.Integer(value = i) -> string i |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have the ranges you want to use creationAide.TextFromSource where possible.
src/Fantomas.Core/CodePrinter.fs
Outdated
| | Measure.Divide n -> | ||
| let lhs = n.LeftHandSide |> Option.map genMeasure |> Option.defaultValue id | ||
|
|
||
| lhs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use optSingle genMeasure n.LeftHandSide
…7b5e12842d673b7daa467e0091378bf4acc95e4f - add test - add CHANGELOG entry
|
Hey @josh-degraw , |
This makes use of the new modeling of
SynMeasure.Divide.Now that the
measure1is optional, we have a chance to see, if the original code had it or not.fixes #2926 and #2927