-
-
Notifications
You must be signed in to change notification settings - Fork 442
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
feat(css_parser): implement CSS unicode range #3251
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ac925c3
feat(css_parser): Implement CSS unicode range
denbezrukov 1668f93
feat(css_parser): Implement CSS unicode range
denbezrukov a47a611
feat(css_parser): Implement CSS unicode range
denbezrukov 4d51af2
feat(css_parser): Implement CSS unicode range
denbezrukov 1e03b3e
feat(css_parser): Implement CSS unicode range
denbezrukov fedd676
Update crates/biome_css_parser/src/syntax/property/unicode_range.rs
denbezrukov ac2ddb1
Merge branch 'main' into feat/css-unicode-range
denbezrukov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
//! This is a generated file. Don't modify it by hand! Run 'cargo codegen formatter' to re-generate the file. | ||
|
||
use crate::prelude::*; | ||
use biome_css_syntax::AnyCssUnicodeValue; | ||
#[derive(Debug, Clone, Default)] | ||
pub(crate) struct FormatAnyCssUnicodeValue; | ||
impl FormatRule<AnyCssUnicodeValue> for FormatAnyCssUnicodeValue { | ||
type Context = CssFormatContext; | ||
fn fmt(&self, node: &AnyCssUnicodeValue, f: &mut CssFormatter) -> FormatResult<()> { | ||
match node { | ||
AnyCssUnicodeValue::CssBogusUnicodeRangeValue(node) => node.format().fmt(f), | ||
AnyCssUnicodeValue::CssUnicodeCodepoint(node) => node.format().fmt(f), | ||
AnyCssUnicodeValue::CssUnicodeRangeInterval(node) => node.format().fmt(f), | ||
AnyCssUnicodeValue::CssUnicodeRangeWildcard(node) => node.format().fmt(f), | ||
} | ||
} | ||
} |
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
13 changes: 13 additions & 0 deletions
13
crates/biome_css_formatter/src/css/auxiliary/unicode_codepoint.rs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use crate::prelude::*; | ||
use biome_css_syntax::{CssUnicodeCodepoint, CssUnicodeCodepointFields}; | ||
use biome_formatter::write; | ||
|
||
#[derive(Debug, Clone, Default)] | ||
pub(crate) struct FormatCssUnicodeCodepoint; | ||
impl FormatNodeRule<CssUnicodeCodepoint> for FormatCssUnicodeCodepoint { | ||
fn fmt_fields(&self, node: &CssUnicodeCodepoint, f: &mut CssFormatter) -> FormatResult<()> { | ||
let CssUnicodeCodepointFields { value_token } = node.as_fields(); | ||
|
||
write!(f, [value_token.format(),]) | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
crates/biome_css_formatter/src/css/auxiliary/unicode_range.rs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use crate::prelude::*; | ||
use biome_css_syntax::{CssUnicodeRange, CssUnicodeRangeFields}; | ||
use biome_formatter::write; | ||
|
||
#[derive(Debug, Clone, Default)] | ||
pub(crate) struct FormatCssUnicodeRange; | ||
impl FormatNodeRule<CssUnicodeRange> for FormatCssUnicodeRange { | ||
fn fmt_fields(&self, node: &CssUnicodeRange, f: &mut CssFormatter) -> FormatResult<()> { | ||
let CssUnicodeRangeFields { | ||
prefix_token, | ||
value, | ||
} = node.as_fields(); | ||
|
||
write!(f, [prefix_token.format(), value.format()]) | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
crates/biome_css_formatter/src/css/auxiliary/unicode_range_interval.rs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use crate::prelude::*; | ||
use biome_css_syntax::{CssUnicodeRangeInterval, CssUnicodeRangeIntervalFields}; | ||
use biome_formatter::write; | ||
|
||
#[derive(Debug, Clone, Default)] | ||
pub(crate) struct FormatCssUnicodeRangeInterval; | ||
impl FormatNodeRule<CssUnicodeRangeInterval> for FormatCssUnicodeRangeInterval { | ||
fn fmt_fields(&self, node: &CssUnicodeRangeInterval, f: &mut CssFormatter) -> FormatResult<()> { | ||
let CssUnicodeRangeIntervalFields { | ||
start, | ||
minus_token, | ||
end, | ||
} = node.as_fields(); | ||
write!(f, [start.format(), minus_token.format(), end.format()]) | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
crates/biome_css_formatter/src/css/auxiliary/unicode_range_wildcard.rs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use crate::prelude::*; | ||
use biome_css_syntax::{CssUnicodeRangeWildcard, CssUnicodeRangeWildcardFields}; | ||
use biome_formatter::write; | ||
|
||
#[derive(Debug, Clone, Default)] | ||
pub(crate) struct FormatCssUnicodeRangeWildcard; | ||
impl FormatNodeRule<CssUnicodeRangeWildcard> for FormatCssUnicodeRangeWildcard { | ||
fn fmt_fields(&self, node: &CssUnicodeRangeWildcard, f: &mut CssFormatter) -> FormatResult<()> { | ||
let CssUnicodeRangeWildcardFields { value_token } = node.as_fields(); | ||
|
||
write!(f, [value_token.format(),]) | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
crates/biome_css_formatter/src/css/bogus/bogus_unicode_range_value.rs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
use crate::FormatBogusNodeRule; | ||
use biome_css_syntax::CssBogusUnicodeRangeValue; | ||
#[derive(Debug, Clone, Default)] | ||
pub(crate) struct FormatCssBogusUnicodeRangeValue; | ||
impl FormatBogusNodeRule<CssBogusUnicodeRangeValue> for FormatCssBogusUnicodeRangeValue {} |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to consider how to handle such an invalid css in the future...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that it could be a rule.
Like
noUnknownUnicodeRange
or something?