Skip to content

Conversation

@robertDurst
Copy link

@robertDurst robertDurst commented Dec 27, 2025

Address #5225 .

Specifically, this PR:

  1. ensures that the positions of comments within nested function params are maintained by popping comments per argument rather than collecting all and appending at the end.
  2. adds a unit test to reproduce bug and demonstrate it is fixed (with some bonus edge cases).
  3. updates expected comment order in the test comment_in_tuple_return_type per 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 😁

r#"pub fn main() -> #(
String,
// This is a string
String,
Copy link
Author

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)

@robertDurst robertDurst marked this pull request as ready for review December 29, 2025 17:45
@ankddev
Copy link
Contributor

ankddev commented Dec 29, 2025

Hey @robertDurst! Could you add a changelog entry (see existing entries for inspiration)?

@robertDurst robertDurst changed the title Inner Fn Arg Formatting Fix (#5225) Fix formatter reordering comments in function type parameters Dec 29, 2025
@robertDurst
Copy link
Author

Hey @robertDurst! Could you add a changelog entry (see existing entries for inspiration)?

Done! Thanks for catching this @ankddev ... had the CONTRIBUTING.md open in a tab ... longingly waiting for me to read it 🤦

@robertDurst
Copy link
Author

Ok, cleaned up the commit history, should be GTG for an initial review.

Thanks in advance and happy holidays 🥳 🎄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants