Skip to content
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

challenge(formatter): fix self closing compatibility with Prettier #733

Merged
merged 1 commit into from Nov 15, 2023

Conversation

@github-actions github-actions bot added A-Formatter Area: formatter L-JavaScript Language: JavaScript and super languages labels Nov 15, 2023
@@ -542,6 +546,20 @@ impl<I: Iterator> JsxChildrenIterator<I> {
})
.as_ref()
}

pub fn peek_next_next(&mut self) -> Option<&I::Item> {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one question. Should JsxChildrenIterator be modified so that it can retrieve a specified number of elements ahead, like look_ahead? I often commit to rustc, so I mentioned rustc as an example.

Copy link
Member

@unvalley unvalley Nov 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think following the implementation of look_ahead in rustc is good. However, rewriting this util may increase the code diffs considerably, so a separate PR would be fine.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I will implement it in a new pull request!

@ematipico ematipico changed the title challenge(formatter) fix self closing compatibility with Prettier challenge(formatter): fix self closing compatibility with Prettier Nov 15, 2023
@Conaclos Conaclos requested review from a team November 15, 2023 14:02
Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation looks good to me! Thank you. I think it's worth implementing the look_ahead in a septate PR, as @unvalley cleverly suggested.

@ematipico ematipico merged commit 493782e into biomejs:main Nov 15, 2023
12 checks passed
@TaKO8Ki TaKO8Ki deleted the fix-self-closing-format branch November 16, 2023 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Formatter Area: formatter L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants