-
-
Notifications
You must be signed in to change notification settings - Fork 908
Fix formatter reordering comments in function type parameters #5229
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
base: main
Are you sure you want to change the base?
Conversation
| r#"pub fn main() -> #( | ||
| String, | ||
| // This is a string | ||
| String, |
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.
Test fix as per comment in conversation here: #5225 (comment)
|
Hey @robertDurst! Could you add a changelog entry (see existing entries for inspiration)? |
Done! Thanks for catching this @ankddev ... had the |
43bb33f to
65fbd1b
Compare
|
Ok, cleaned up the commit history, should be GTG for an initial review. Thanks in advance and happy holidays 🥳 🎄 |
lpil
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.
Thank you!! I've left a small comment inline
compiler-core/src/format.rs
Outdated
| } | ||
| } | ||
|
|
||
| fn wrap_arguments_with_line_breaks<'a, 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.
How come this is needed when none of the other matching syntaxes need this? Can we not use the same approach for all of them?
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.
Thanks for the review! Let me take another pass here - had a nice few days off here on holiday, refreshed and with a clear mind 🧘
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.
Thank you 💜 Happy new year!
65fbd1b to
4926043
Compare
lpil
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.
Thank you! I've left a note inline about the approach.
| .append(")") | ||
| } else { | ||
| self.wrap_arguments(arguments, location.end) | ||
| } |
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.
It looks like this duplicates the code within wrap_arguments. Why is it that that code didn't do the job?
I think we should work out what the bug was there so it works for all (...), rather than having a special case where the code is replicated here.
Address #5225 .
Specifically, this PR:
comment_in_tuple_return_typeper conversations in Formatter reoders comments inside function types #5225.Tried my best to follow of convention. Long term goal here is to hopefully continue finding places to contribute, so nit picks of all sizes appreciated 😁