-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parse candidates in
.svelte
files with class:abc="condition"
synt…
…ax (#13274) * handle `.svelte` file In svelte there is a convention where you can use `<div class:px-4="condition" />` which means that we extract `class:px-4` as a utility where `class` is a variant. This is obviously incorrect, to solve this we can ignore the `class:` part before parsing the whole file. This is also what we do in v3. Ideally we have completely separate parsers for various programming languages (based on file type) and fallback to the generic one we have now. Implementing that, is a much bigger scope. * flatten match arms * add test to verify we can parse `class:px-4="condition"` * explicitly ingore everything but the svelte file * merge tests There is some funky stuff happening when running `cargo test` where it sees contents from another test. Maybe a bug in the tmpdir crate. I don't see this problem locally when running `cargo nextest run`, but when using the native `cargo test` command it fails. * update changelog * run prettier * Update oxide/crates/core/src/lib.rs Co-authored-by: Jordan Pittman <[email protected]> * fixup syntax errors --------- Co-authored-by: Jordan Pittman <[email protected]>
- Loading branch information
1 parent
cdb0997
commit f3e7880
Showing
3 changed files
with
36 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters