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 scanning classes delimited by tab characters #15169

Open
wants to merge 7 commits into
base: next
Choose a base branch
from

Conversation

RobinMalfait
Copy link
Member

@RobinMalfait RobinMalfait commented Nov 25, 2024

This PR fixes an issue where multi-line candidates in Svelte files couldn't be found as reported in #15148

After digging in, the real culprit seems to be that the reproduction used tab \t characters instead of spaces and we only delimited explicitly on spaces.

Initially I couldn't reproduce this in an integration test until we (@thecrypticace and I) realised that \t was being used.

Test plan:

This PR adds an integration test that fails before the fix happens. The fix itself is easy in the sense that we just use all ascii whitespace characters instead of just spaces.

Fixes: #15148

@RobinMalfait RobinMalfait force-pushed the fix/issue-15148 branch 2 times, most recently from 2a4c256 to e6b4458 Compare November 25, 2024 14:45
@RobinMalfait RobinMalfait marked this pull request as ready for review November 25, 2024 15:05
@RobinMalfait RobinMalfait requested a review from a team as a code owner November 25, 2024 15:05
'test-green',
'test-blue',
'test-tomato',
'multiple-entries-to-keep-newlines',
Copy link
Contributor

Choose a reason for hiding this comment

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

My prettier hack is I use an empty // comment to do this

Copy link
Contributor

Choose a reason for hiding this comment

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

(but this is fine too)

Copy link
Member Author

Choose a reason for hiding this comment

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

That introduced a space, so didn't trust it 😂

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah!

@RobinMalfait RobinMalfait changed the title Fix multi-line candidates in Svelte files Fix scanning classes delimited by tab characters Nov 25, 2024
@adamwathan
Copy link
Member

Should there be explicit tests for tabs vs. sort of sneaking it into the multi-line arrays test?

@RobinMalfait
Copy link
Member Author

@adamwathan good call, I added dedicated whitespace related tests (none, spaces, tabs, and newlines) in the Rust tests. Also add an integration test for the CLI.

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.

[v4] Tailwind bails out on candidates inside multiline JS array (Vite+Svelte setup)
3 participants