refactor(css): rename scss declaration and module access syntax#10014
Conversation
|
Parser conformance results onjs/262
jsx/babel
markdown/commonmark
symbols/microsoft
ts/babel
ts/microsoft
|
WalkthroughThis PR renames and repurposes several SCSS AST kinds across the grammar, parser, formatter, grit mappings and generated formatter code: Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (4)
crates/biome_css_parser/src/syntax/at_rule/page.rs (1)
33-34: Minor doc wording nit.Now that the SCSS branch only routes variable declarations, the doc comment could be tightened from "SCSS declarations" to "SCSS variable declarations" to match the narrower behaviour — purely optional.
✏️ Proposed tweak
-/// Parses `@page` and allows SCSS declarations inside the block so variables can be -/// scoped to the at-rule body. +/// Parses `@page` and allows SCSS variable declarations inside the block so +/// variables can be scoped to the at-rule body.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/biome_css_parser/src/syntax/at_rule/page.rs` around lines 33 - 34, Update the doc comment that currently reads "Parses `@page` and allows SCSS declarations inside the block so variables can be scoped to the at-rule body." to more precisely say "Parses `@page` and allows SCSS variable declarations inside the block so variables can be scoped to the at-rule body." Locate the comment above the `@page` parser in this module (the doc for the `@page` at-rule parser that contains the phrase "SCSS declarations") and replace "SCSS declarations" with "SCSS variable declarations".crates/biome_css_parser/src/syntax/value/function/call.rs (1)
150-156: Optional: refresh the diagnostic wording?The AST node is now
ScssModuleMemberAccess, but the error on Line 154 still calls these "SCSS qualified function names". Either reading is defensible (the Sass concept vs. the node name), so feel free to leave it — just flagging in case you want full consistency with the rename theme of the PR.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/biome_css_parser/src/syntax/value/function/call.rs` around lines 150 - 156, The diagnostic message uses "SCSS qualified function names" but the AST node was renamed to ScssModuleMemberAccess; update the scss_only_syntax_error invocation so the wording matches the node/name (e.g., "SCSS module member access" or "SCSS module-qualified function names") in the call inside the CssSyntaxFeatures::Scss.parse_exclusive_syntax closure (the code path using context.is_scss_exclusive_syntax_allowed() and is_at_scss_module_member_access(p)), replacing the string passed to scss_only_syntax_error to keep message and node-name consistent.crates/biome_css_parser/src/syntax/mod.rs (1)
22-30: Rename looks clean, but the import block ordering got a bit shuffled.Nit: items like
is_at_scss_variable_declarationare now interleaved betweenis_at_scss_functionandis_at_scss_interpolated_function_or_value, which breaks the old roughly-alphabetical grouping andrustfmtprobably won't rescue it. Purely cosmetic — feel free to ignore ifjust fis happy.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/biome_css_parser/src/syntax/mod.rs` around lines 22 - 30, The import list has been shuffled and breaks the previous roughly-alphabetical grouping; reorder the items in the use crate::syntax::scss::... list so related symbols are grouped/alphabetized (e.g., put is_at_scss_function, is_at_scss_interpolated_function_or_value, is_at_scss_interpolated_string, is_at_scss_module_member_access, is_at_scss_parent_selector_value, is_at_scss_variable, is_at_scss_variable_declaration together in proper alphabetical order) so the block is tidy and rustfmt/just f will keep it stable.crates/biome_css_parser/src/syntax/scss/identifiers/identifier.rs (1)
1-78: File name is now a bit of a false advertisement.Optional:
identifier.rsno longer contains anything identifier-flavoured — justScssVariable/ScssNamespacedVariable. Renaming the file tovariable.rs(and perhaps the parent moduleidentifiers/tovariables/or similar) would close the loop on the rename; otherwise future readers will keep asking where the "identifier" actually is. Happy to defer to a follow-up.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/biome_css_parser/src/syntax/scss/identifiers/identifier.rs` around lines 1 - 78, The file identifier.rs now only contains SCSS variable logic (is_at_scss_variable, parse_scss_variable, is_at_scss_namespaced_variable, parse_scss_namespaced_variable) and should be renamed to variable.rs to reflect its contents; update any module declarations and imports that reference the old identifiers module name (e.g. change mod/uses of identifiers::identifier or identifiers to variables::variable or variables) and adjust parent module name if you choose to rename identifiers/ to variables/—ensure all references to the old symbols are updated so the compiler sees the new module path.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@crates/biome_css_parser/src/syntax/at_rule/page.rs`:
- Around line 33-34: Update the doc comment that currently reads "Parses `@page`
and allows SCSS declarations inside the block so variables can be scoped to the
at-rule body." to more precisely say "Parses `@page` and allows SCSS variable
declarations inside the block so variables can be scoped to the at-rule body."
Locate the comment above the `@page` parser in this module (the doc for the
`@page` at-rule parser that contains the phrase "SCSS declarations") and replace
"SCSS declarations" with "SCSS variable declarations".
In `@crates/biome_css_parser/src/syntax/mod.rs`:
- Around line 22-30: The import list has been shuffled and breaks the previous
roughly-alphabetical grouping; reorder the items in the use
crate::syntax::scss::... list so related symbols are grouped/alphabetized (e.g.,
put is_at_scss_function, is_at_scss_interpolated_function_or_value,
is_at_scss_interpolated_string, is_at_scss_module_member_access,
is_at_scss_parent_selector_value, is_at_scss_variable,
is_at_scss_variable_declaration together in proper alphabetical order) so the
block is tidy and rustfmt/just f will keep it stable.
In `@crates/biome_css_parser/src/syntax/scss/identifiers/identifier.rs`:
- Around line 1-78: The file identifier.rs now only contains SCSS variable logic
(is_at_scss_variable, parse_scss_variable, is_at_scss_namespaced_variable,
parse_scss_namespaced_variable) and should be renamed to variable.rs to reflect
its contents; update any module declarations and imports that reference the old
identifiers module name (e.g. change mod/uses of identifiers::identifier or
identifiers to variables::variable or variables) and adjust parent module name
if you choose to rename identifiers/ to variables/—ensure all references to the
old symbols are updated so the compiler sees the new module path.
In `@crates/biome_css_parser/src/syntax/value/function/call.rs`:
- Around line 150-156: The diagnostic message uses "SCSS qualified function
names" but the AST node was renamed to ScssModuleMemberAccess; update the
scss_only_syntax_error invocation so the wording matches the node/name (e.g.,
"SCSS module member access" or "SCSS module-qualified function names") in the
call inside the CssSyntaxFeatures::Scss.parse_exclusive_syntax closure (the code
path using context.is_scss_exclusive_syntax_allowed() and
is_at_scss_module_member_access(p)), replacing the string passed to
scss_only_syntax_error to keep message and node-name consistent.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: fe66401b-eddc-46a4-b650-9776ec68768d
⛔ Files ignored due to path filters (123)
crates/biome_css_factory/src/generated/node_factory.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_css_factory/src/generated/syntax_factory.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_css_parser/tests/css_test_suite/error/function/scss_qualified_function.css.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/at-rule/debug.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/at-rule/each.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/at-rule/else.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/at-rule/error.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/at-rule/for.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/at-rule/forward.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/at-rule/function.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/at-rule/if.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/at-rule/include.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/at-rule/media-interpolation.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/at-rule/mixin.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/at-rule/page-selector-like-declaration.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/at-rule/supports-interpolated-property-missing-colon.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/at-rule/supports-interpolated-property-missing-value.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/at-rule/use.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/at-rule/while.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/declaration/duplicate-modifier-recovery.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/declaration/interpolated-selector-recovery.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/declaration/interpolation.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/declaration/invalid-modifier.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/declaration/missing-modifier.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/declaration/missing-semicolon-boundary-matrix.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/declaration/missing-semicolon-namespace-selector-recovery.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/declaration/missing-semicolon-recovery.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/declaration/missing-semicolon-relative-selector-recovery.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/declaration/missing-semicolon-selector-recovery.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/declaration/missing-value.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/declaration/modifier-recovery.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/expression/arglist-ellipsis-recovery.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/expression/ellipsis.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/expression/interpolation.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/expression/list-recovery.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/expression/missing-expressions.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/expression/paren-map-missing-value.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/recovery/map-missing-value.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/selector/interpolation.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/value/bracketed-mixed-separators.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/value/bracketed-recovery-separators.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/value/function-args-block-end-recovery.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/value/interpolation-non-string-quote.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/value/qualified-name-dollar-function.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/value/string-interpolation-invalid-escape.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/value/string-interpolation-invalid-string-text.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/scss/value/string-interpolation.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/at-rule/content.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/at-rule/debug.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/at-rule/declaration-block-interpolation.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/at-rule/each.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/at-rule/else.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/at-rule/error.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/at-rule/extend.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/at-rule/for.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/at-rule/forward.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/at-rule/function.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/at-rule/if.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/at-rule/import.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/at-rule/include.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/at-rule/media-interpolation.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/at-rule/mixin.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/at-rule/page.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/at-rule/return.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/at-rule/supports-expression.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/at-rule/use.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/at-rule/warn.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/at-rule/while.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/comment/multiline.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/comment/nested.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/ambiguous-selector-vs-nesting.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/duplicate-modifier.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/global-flag.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/interpolation.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/namespace-properties.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/namespaced-function.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/namespaced-variable.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/nested-properties-complex-value.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/nested-variables.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/declaration/semicolon-eof.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/expression/complex-expressions.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/expression/core.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/expression/edge-cases-extra.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/expression/fallback-values.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/expression/interpolation.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/expression/keyword-argument-context.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/expression/map-key-colon.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/expression/map-vs-paren-list.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/expression/precedence.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/selector/interpolated-string-values.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/selector/interpolation.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/binary-operators.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/bracketed-values.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/builtin-modules.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/function-args-inline.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/function-call.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/functions-advanced.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/if-disambiguation.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/interpolated-minus-line-break.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/keyword-args-ellipsis.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/list-advanced.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/list-empty-elements.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/list-important-item.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/list-space.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/list.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/map-advanced.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/map-expression-key.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/map-list-access.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/map.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/number.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/parent-and-colon-values.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/plain-vs-interpolated-string.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/qualified-names.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/signed-numeric-operator.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/string-interpolation-nested-strings.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/string-interpolation.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/unary-operator-chain.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/unary-operators.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/scss/value/url.scss.snapis excluded by!**/*.snapand included by**crates/biome_css_syntax/src/generated/kind.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_css_syntax/src/generated/macros.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_css_syntax/src/generated/nodes.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_css_syntax/src/generated/nodes_mut.rsis excluded by!**/generated/**,!**/generated/**and included by**
📒 Files selected for processing (47)
crates/biome_css_analyze/src/assist/source/use_sorted_properties.rscrates/biome_css_formatter/src/css/any/declaration.rscrates/biome_css_formatter/src/css/any/declaration_or_at_rule.rscrates/biome_css_formatter/src/css/any/declaration_or_rule.rscrates/biome_css_formatter/src/css/any/function_name.rscrates/biome_css_formatter/src/css/any/page_at_rule_item.rscrates/biome_css_formatter/src/css/any/root_item.rscrates/biome_css_formatter/src/css/any/value.rscrates/biome_css_formatter/src/generated.rscrates/biome_css_formatter/src/scss/any/declaration_name.rscrates/biome_css_formatter/src/scss/any/include_target.rscrates/biome_css_formatter/src/scss/any/mod.rscrates/biome_css_formatter/src/scss/any/module_member.rscrates/biome_css_formatter/src/scss/any/variable_declaration_name.rscrates/biome_css_formatter/src/scss/auxiliary/mod.rscrates/biome_css_formatter/src/scss/auxiliary/module_member_access.rscrates/biome_css_formatter/src/scss/auxiliary/namespaced_variable.rscrates/biome_css_formatter/src/scss/auxiliary/qualified_name.rscrates/biome_css_formatter/src/scss/auxiliary/variable.rscrates/biome_css_formatter/src/scss/auxiliary/variable_declaration.rscrates/biome_css_formatter/src/scss/value/identifier.rscrates/biome_css_formatter/src/scss/value/mod.rscrates/biome_css_formatter/src/scss/value/namespaced_identifier.rscrates/biome_css_parser/src/syntax/at_rule/page.rscrates/biome_css_parser/src/syntax/block/declaration_or_at_rule_list_block.rscrates/biome_css_parser/src/syntax/block/declaration_or_rule_list_block.rscrates/biome_css_parser/src/syntax/declaration.rscrates/biome_css_parser/src/syntax/mod.rscrates/biome_css_parser/src/syntax/scss/at_rule/each_at_rule.rscrates/biome_css_parser/src/syntax/scss/at_rule/for_at_rule.rscrates/biome_css_parser/src/syntax/scss/at_rule/module_clauses.rscrates/biome_css_parser/src/syntax/scss/at_rule/parameter.rscrates/biome_css_parser/src/syntax/scss/declaration/mod.rscrates/biome_css_parser/src/syntax/scss/declaration/variable.rscrates/biome_css_parser/src/syntax/scss/expression/list.rscrates/biome_css_parser/src/syntax/scss/function_name.rscrates/biome_css_parser/src/syntax/scss/identifiers/identifier.rscrates/biome_css_parser/src/syntax/scss/identifiers/mod.rscrates/biome_css_parser/src/syntax/scss/identifiers/module_member_access.rscrates/biome_css_parser/src/syntax/scss/mod.rscrates/biome_css_parser/src/syntax/scss/value/any.rscrates/biome_css_parser/src/syntax/scss/value/function.rscrates/biome_css_parser/src/syntax/value/function/call.rscrates/biome_grit_patterns/src/grit_target_language/css_target_language/constants.rscrates/biome_grit_patterns/src/grit_target_language/css_target_language/generated_mappings.rsxtask/codegen/css.ungramxtask/codegen/src/css_kinds_src.rs
💤 Files with no reviewable changes (5)
- crates/biome_css_formatter/src/scss/value/namespaced_identifier.rs
- crates/biome_css_formatter/src/scss/any/declaration_name.rs
- crates/biome_css_formatter/src/scss/auxiliary/qualified_name.rs
- crates/biome_css_formatter/src/scss/value/mod.rs
- crates/biome_css_formatter/src/scss/value/identifier.rs
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
crates/biome_css_parser/src/syntax/value/function/call.rs (1)
150-155: Stale wording in the diagnostic after the rename.The rest of the PR moves from "qualified name" to "module member access", but the user-facing error string on line 153 still says "SCSS qualified function names". Not broken, just a small drift worth tidying while you're here.
✏️ Suggested tweak
- scss_only_syntax_error(p, "SCSS qualified function names", marker.range(p)) + scss_only_syntax_error(p, "SCSS module member access function names", marker.range(p))🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/biome_css_parser/src/syntax/value/function/call.rs` around lines 150 - 155, Update the stale user-facing diagnostic string used when SCSS exclusive syntax is detected: in the call chain on CssSyntaxFeatures::Scss.parse_exclusive_syntax (the closure that calls scss_only_syntax_error), replace the message "SCSS qualified function names" with wording consistent with the PR rename (e.g. "SCSS module member access"). Locate the use site guarded by context.is_scss_exclusive_syntax_allowed() and is_at_scss_module_member_access(p) and change only the diagnostic text passed to scss_only_syntax_error so other behavior remains identical.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@crates/biome_css_parser/src/syntax/value/function/call.rs`:
- Around line 117-120: The SCSS module-member detection here hardcodes
p.nth_at(n + 3, T!['(']) but needs to mirror the SCSS-specific branching used in
is_at_scss_function: update the condition inside the block that references
is_nth_at_scss_module_member_access so it checks p.nth_at(n + 2, T![$]) and, if
true, tests for '(' at n + 4, otherwise at n + 3; ensure this change is applied
where context.is_scss_exclusive_syntax_allowed() is used alongside
is_nth_at_scss_module_member_access so the generic path matches the SCSS
helper's offsets.
---
Nitpick comments:
In `@crates/biome_css_parser/src/syntax/value/function/call.rs`:
- Around line 150-155: Update the stale user-facing diagnostic string used when
SCSS exclusive syntax is detected: in the call chain on
CssSyntaxFeatures::Scss.parse_exclusive_syntax (the closure that calls
scss_only_syntax_error), replace the message "SCSS qualified function names"
with wording consistent with the PR rename (e.g. "SCSS module member access").
Locate the use site guarded by context.is_scss_exclusive_syntax_allowed() and
is_at_scss_module_member_access(p) and change only the diagnostic text passed to
scss_only_syntax_error so other behavior remains identical.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8dc8839b-5efe-431e-ae17-1d58be372f72
📒 Files selected for processing (10)
crates/biome_css_formatter/src/scss/auxiliary/module_member_access.rscrates/biome_css_formatter/src/scss/auxiliary/variable_declaration.rscrates/biome_css_parser/src/syntax/declaration.rscrates/biome_css_parser/src/syntax/mod.rscrates/biome_css_parser/src/syntax/scss/at_rule/parameter.rscrates/biome_css_parser/src/syntax/scss/declaration/mod.rscrates/biome_css_parser/src/syntax/scss/mod.rscrates/biome_css_parser/src/syntax/scss/value/any.rscrates/biome_css_parser/src/syntax/scss/value/function.rscrates/biome_css_parser/src/syntax/value/function/call.rs
🚧 Files skipped from review as they are similar to previous changes (6)
- crates/biome_css_parser/src/syntax/scss/at_rule/parameter.rs
- crates/biome_css_parser/src/syntax/scss/declaration/mod.rs
- crates/biome_css_formatter/src/scss/auxiliary/variable_declaration.rs
- crates/biome_css_parser/src/syntax/mod.rs
- crates/biome_css_parser/src/syntax/scss/mod.rs
- crates/biome_css_parser/src/syntax/scss/value/any.rs
| || (context.is_scss_exclusive_syntax_allowed() | ||
| && is_nth_at_scss_qualified_name(p, n) | ||
| && is_nth_at_scss_module_member_access(p, n) | ||
| && p.nth_at(n + 3, T!['('])) | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find all callers of is_at_scss_function / is_nth_at_scss_function to confirm
# they run ahead of the generic function detector on the SCSS-aware path.
rg -nP '\b(is_at_scss_function|is_nth_at_scss_function|is_at_function_with_context|is_nth_at_function_with_context)\b' --type=rust -C2Repository: biomejs/biome
Length of output: 9747
🏁 Script executed:
# Read the specific function where the potential issue is
sed -n '111,125p' crates/biome_css_parser/src/syntax/value/function/call.rsRepository: biomejs/biome
Length of output: 519
🏁 Script executed:
# Check the is_nth_at_scss_module_member_access implementation
rg -A10 'fn is_nth_at_scss_module_member_access' crates/biome_css_parser/src/syntax/scss/Repository: biomejs/biome
Length of output: 1309
🏁 Script executed:
# Check the suggested alignment location in scss/value/function.rs
sed -n '20,40p' crates/biome_css_parser/src/syntax/scss/value/function.rsRepository: biomejs/biome
Length of output: 690
🏁 Script executed:
# Check how is_at_scss_function is used in the parsing path
rg -B5 -A5 'is_nth_at_function_with_context' crates/biome_css_parser/src/syntax/ | head -60Repository: biomejs/biome
Length of output: 2680
🏁 Script executed:
# Verify the parsing order in scss/value/any.rs where is_at_scss_function is used
sed -n '14,65p' crates/biome_css_parser/src/syntax/scss/value/any.rsRepository: biomejs/biome
Length of output: 1789
Align n + 3 offset to match is_nth_at_scss_module_member_access cases.
is_nth_at_scss_module_member_access supports both module.name (4 tokens, ( at n + 3) and module.$name (5 tokens, ( at n + 4). The SCSS-specific helper in scss/value/function.rs (lines 35–37) correctly branches on p.nth_at(n + 2, T![$]), but this generic path still hardcodes n + 3.
In practice, is_at_scss_function runs first on the SCSS-aware path and absorbs this case, so it's dormant. But the two detectors drifting apart is a maintenance risk—worth mirroring the offset logic for consistency.
🔧 Suggested alignment
is_nth_at_identifier(p, n) && p.nth_at(n + 1, T!['('])
|| (context.is_scss_exclusive_syntax_allowed()
&& is_nth_at_scss_module_member_access(p, n)
- && p.nth_at(n + 3, T!['(']))
+ && p.nth_at(n + if p.nth_at(n + 2, T![$]) { 4 } else { 3 }, T!['(']))
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| || (context.is_scss_exclusive_syntax_allowed() | |
| && is_nth_at_scss_qualified_name(p, n) | |
| && is_nth_at_scss_module_member_access(p, n) | |
| && p.nth_at(n + 3, T!['('])) | |
| } | |
| || (context.is_scss_exclusive_syntax_allowed() | |
| && is_nth_at_scss_module_member_access(p, n) | |
| && p.nth_at(n + if p.nth_at(n + 2, T![$]) { 4 } else { 3 }, T!['('])) | |
| } |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@crates/biome_css_parser/src/syntax/value/function/call.rs` around lines 117 -
120, The SCSS module-member detection here hardcodes p.nth_at(n + 3, T!['('])
but needs to mirror the SCSS-specific branching used in is_at_scss_function:
update the condition inside the block that references
is_nth_at_scss_module_member_access so it checks p.nth_at(n + 2, T![$]) and, if
true, tests for '(' at n + 4, otherwise at n + 3; ensure this change is applied
where context.is_scss_exclusive_syntax_allowed() is used alongside
is_nth_at_scss_module_member_access so the generic path matches the SCSS
helper's offsets.
Merging this PR will not alter performance
Comparing Footnotes
|
Summary
Renames the SCSS variable, variable-declaration, and module-access syntax families to match the grammar
more accurately:
ScssIdentifier->ScssVariableScssNamespacedIdentifier->ScssNamespacedVariableScssDeclaration->ScssVariableDeclarationAnyScssDeclarationName->AnyScssVariableDeclarationNameScssQualifiedName->ScssModuleMemberAccessTest Plan
Green CI.