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

fix(css_formatter): fix CSS nesting whitespace after & trimmed #3061 #3082

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

denbezrukov
Copy link
Contributor

@denbezrukov denbezrukov commented Jun 5, 2024

Summary

Close #3061

The problem arose from using the wrong lexer context after processing the '&' token.

Test Plan

cargo test

@github-actions github-actions bot added A-Core Area: core A-Formatter Area: formatter L-CSS Language: CSS A-Changelog Area: changelog labels Jun 5, 2024
@denbezrukov denbezrukov changed the title fix(css_formatter): CSS nesting whitespace after & trimmed #3061 fix(css_formatter): fix CSS nesting whitespace after & trimmed #3061 Jun 5, 2024
Copy link
Contributor

github-actions bot commented Jun 5, 2024

Parser conformance results on

js/262

Test result main count This PR count Difference
Total 50793 50793 0
Passed 49686 49686 0
Failed 1107 1107 0
Panics 0 0 0
Coverage 97.82% 97.82% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 40 40 0
Passed 37 37 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.50% 92.50% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 6534 6534 0
Passed 2087 2087 0
Failed 4447 4447 0
Panics 0 0 0
Coverage 31.94% 31.94% 0.00%

ts/babel

Test result main count This PR count Difference
Total 667 667 0
Passed 595 595 0
Failed 72 72 0
Panics 0 0 0
Coverage 89.21% 89.21% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 18217 18217 0
Passed 13961 13961 0
Failed 4256 4256 0
Panics 0 0 0
Coverage 76.64% 76.64% 0.00%

Copy link

codspeed-hq bot commented Jun 5, 2024

CodSpeed Performance Report

Merging #3082 will not alter performance

Comparing fix/nesting (acc93c2) with main (eb8de09)

Summary

✅ 92 untouched benchmarks

@ah-yu
Copy link
Contributor

ah-yu commented Jun 6, 2024

Should we add extra space after the nesting selector if it has trailing comments? It seems Prettier doesn't handle the case very well 😅 playground link

@denbezrukov
Copy link
Contributor Author

Should we add extra space after the nesting selector if it has trailing comments? It seems Prettier doesn't handle the case very well 😅 playground link

Interesting, thank you for that case! Actually, I don't know; it seems that the parser returns an unknown selector if there is a comment between & and .child.

@denbezrukov denbezrukov marked this pull request as draft June 6, 2024 04:36
@denbezrukov
Copy link
Contributor Author

Ive converted it to draft because after @ah-yu comment I think that it's a parser issue🙈

@github-actions github-actions bot added the A-Parser Area: parser label Jun 6, 2024
@denbezrukov denbezrukov marked this pull request as ready for review June 6, 2024 14:21
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.

Great fix @denbezrukov! Thank you ❤️

@denbezrukov denbezrukov merged commit e6a5b04 into main Jun 6, 2024
17 checks passed
@denbezrukov denbezrukov deleted the fix/nesting branch June 6, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-Core Area: core A-Formatter Area: formatter A-Parser Area: parser L-CSS Language: CSS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📝 CSS nesting whitespace after & trimmed
3 participants