Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Keep tuple trivia while formatting #1365
Keep tuple trivia while formatting #1365
Changes from 3 commits
5930e3f
b767223
df92bd3
1fc4e4a
e818b29
ba82f4a
284c9b1
a26dca9
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This looks like a bug, I would have expected to have either only one space or to have also two spaces for
// jkl
below.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.
Good spot, this can be solved by changing
long
toNotice that sepCommaFixed does not exist yet.
You can add it in Context (right under sepComma):
The
Fixed
convention means, give me the value without checking the configuration if there should be a space.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.
Let me know if this isn't the expected location for this comment trivia.
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.
Well, this is another bug related to the assignment of trivia to a trivia node.
In short, Fantomas detected the comment
// mno
and has to find an anchor to attach it.It chose to add it before the closing parenthesis
)
instead of after theSynExpr.Tuple
.I'm aware of these situations, but it is quite complex to solve to be fair.
For this PR you can leave it like that.
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.
I have used
rangeOfTuple
as suggested but I have seen you are using bothrangeOfXXX
andXXXRange
notation in the code so let me know if you prefer the other.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.
Hmm, good remark. Perhaps go for
tupleRange
instead.Both do appear in the code base indeed, this hasn't really been a conscious decision I think.