refactor(core): add biome_languages crate - #10590
Conversation
|
✅ Organic activityNo automation signals detected in the analyzed events. This is an automated analysis by AgentScan |
Parser conformance results onjs/262
jsx/babel
markdown/commonmark
symbols/microsoft
ts/babel
ts/microsoft
|
Merging this PR will improve performance by 11.17%
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds a new crate crates/biome_languages that centralises file-source types (DocumentFileSource, *FileSource) and embedding-kind enums (CssEmbeddingKind, JsEmbeddingKind). Removes per-syntax crate file_source re-exports and updates manifests and imports across parsers, formatters, analyzers, service/workspace, tests, fuzz targets and docs to use the new shared types. Some formatters/constructors were adjusted where file-source parameters or constructors changed. Possibly related PRs
Suggested reviewers
✨ Finishing Touches🧪 Generate unit tests (beta)
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/biome_jsdoc_comment/Cargo.toml`:
- Line 21: The dev-dependency entry for biome_languages in Cargo.toml uses
workspace = true but must be a path dependency for internal biome_* crates;
update the [dev-dependencies] entry for biome_languages (the line currently
reading biome_languages = { workspace = true, features = ["lang_js"] }) to use a
path attribute pointing to the internal crate (preserve the features array),
i.e. replace workspace = true with path = "<relative path to the biome_languages
crate>" so Cargo treats it as a local crate reference.
🪄 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: 4e35af35-b803-4b73-a71f-0ae21a3dd248
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lockand included by**
📒 Files selected for processing (299)
Cargo.tomlcrates/biome_cli/Cargo.tomlcrates/biome_cli/src/commands/search.rscrates/biome_cli/src/execute/migrate.rscrates/biome_cli/src/runner/handler.rscrates/biome_cli/src/runner/process_file.rscrates/biome_cli/tests/snap_test.rscrates/biome_css_analyze/Cargo.tomlcrates/biome_css_analyze/benches/css_analyzer.rscrates/biome_css_analyze/src/lib.rscrates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rscrates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_element.rscrates/biome_css_analyze/src/lint/style/no_value_at_rule.rscrates/biome_css_analyze/tests/quick_test.rscrates/biome_css_analyze/tests/spec_tests.rscrates/biome_css_formatter/Cargo.tomlcrates/biome_css_formatter/benches/css_formatter.rscrates/biome_css_formatter/src/context.rscrates/biome_css_formatter/src/lib.rscrates/biome_css_formatter/tests/language.rscrates/biome_css_formatter/tests/prettier_tests.rscrates/biome_css_parser/Cargo.tomlcrates/biome_css_parser/benches/css_parser.rscrates/biome_css_parser/src/lexer/mod.rscrates/biome_css_parser/src/lexer/tests.rscrates/biome_css_parser/src/lib.rscrates/biome_css_parser/src/parser.rscrates/biome_css_parser/src/syntax/block/conditional_block.rscrates/biome_css_parser/src/syntax/block/declaration_or_rule_list_block.rscrates/biome_css_parser/src/syntax/mod.rscrates/biome_css_parser/src/token_source.rscrates/biome_css_parser/tests/quick_test.rscrates/biome_css_parser/tests/spec_test.rscrates/biome_css_semantic/Cargo.tomlcrates/biome_css_semantic/src/format_semantic_model.rscrates/biome_css_semantic/src/semantic_model/mod.rscrates/biome_css_semantic/src/tests/selector.rscrates/biome_css_semantic/src/tests/specificity.rscrates/biome_css_syntax/src/lib.rscrates/biome_css_syntax/src/scss_ext/expression.rscrates/biome_formatter_test/Cargo.tomlcrates/biome_formatter_test/src/lib.rscrates/biome_formatter_test/src/spec.rscrates/biome_graphql_analyze/Cargo.tomlcrates/biome_graphql_analyze/tests/spec_tests.rscrates/biome_graphql_formatter/Cargo.tomlcrates/biome_graphql_formatter/src/context.rscrates/biome_graphql_formatter/tests/language.rscrates/biome_graphql_syntax/src/lib.rscrates/biome_grit_formatter/Cargo.tomlcrates/biome_grit_formatter/src/context.rscrates/biome_grit_patterns/Cargo.tomlcrates/biome_grit_patterns/src/grit_css_parser.rscrates/biome_grit_patterns/src/grit_js_parser.rscrates/biome_grit_patterns/src/testing.rscrates/biome_grit_patterns/tests/quick_test.rscrates/biome_grit_syntax/src/lib.rscrates/biome_html_analyze/Cargo.tomlcrates/biome_html_analyze/benches/html_analyzer.rscrates/biome_html_analyze/src/lib.rscrates/biome_html_analyze/src/lint/a11y/no_ambiguous_anchor_text.rscrates/biome_html_analyze/src/lint/a11y/no_aria_hidden_on_focusable.rscrates/biome_html_analyze/src/lint/a11y/no_aria_unsupported_elements.rscrates/biome_html_analyze/src/lint/a11y/no_autofocus.rscrates/biome_html_analyze/src/lint/a11y/no_distracting_elements.rscrates/biome_html_analyze/src/lint/a11y/no_header_scope.rscrates/biome_html_analyze/src/lint/a11y/no_interactive_element_to_noninteractive_role.rscrates/biome_html_analyze/src/lint/a11y/no_label_without_control.rscrates/biome_html_analyze/src/lint/a11y/no_noninteractive_element_to_interactive_role.rscrates/biome_html_analyze/src/lint/a11y/no_redundant_alt.rscrates/biome_html_analyze/src/lint/a11y/no_redundant_roles.rscrates/biome_html_analyze/src/lint/a11y/no_svg_without_title.rscrates/biome_html_analyze/src/lint/a11y/use_alt_text.rscrates/biome_html_analyze/src/lint/a11y/use_anchor_content.rscrates/biome_html_analyze/src/lint/a11y/use_aria_activedescendant_with_tabindex.rscrates/biome_html_analyze/src/lint/a11y/use_button_type.rscrates/biome_html_analyze/src/lint/a11y/use_heading_content.rscrates/biome_html_analyze/src/lint/a11y/use_html_lang.rscrates/biome_html_analyze/src/lint/a11y/use_iframe_title.rscrates/biome_html_analyze/src/lint/a11y/use_key_with_click_events.rscrates/biome_html_analyze/src/lint/a11y/use_key_with_mouse_events.rscrates/biome_html_analyze/src/lint/a11y/use_media_caption.rscrates/biome_html_analyze/src/lint/a11y/use_semantic_elements.rscrates/biome_html_analyze/src/lint/a11y/use_valid_anchor.rscrates/biome_html_analyze/src/lint/a11y/use_valid_aria_values.rscrates/biome_html_analyze/src/lint/a11y/use_valid_autocomplete.rscrates/biome_html_analyze/src/lint/a11y/use_valid_lang.rscrates/biome_html_analyze/src/lint/correctness/use_vue_valid_template_root.rscrates/biome_html_analyze/src/lint/nursery/no_inline_styles.rscrates/biome_html_analyze/src/lint/nursery/use_iframe_sandbox.rscrates/biome_html_analyze/src/lint/nursery/use_scoped_styles.rscrates/biome_html_analyze/src/lint/performance/no_sync_scripts.rscrates/biome_html_analyze/src/lint/performance/use_vue_vapor.rscrates/biome_html_analyze/src/lint/security/no_script_url.rscrates/biome_html_analyze/src/lint/style/use_vue_hyphenated_attributes.rscrates/biome_html_analyze/src/utils.rscrates/biome_html_analyze/tests/spec_tests.rscrates/biome_html_formatter/Cargo.tomlcrates/biome_html_formatter/benches/html_formatter.rscrates/biome_html_formatter/src/context.rscrates/biome_html_formatter/tests/language.rscrates/biome_html_formatter/tests/prettier_tests.rscrates/biome_html_formatter/tests/spec_test.rscrates/biome_html_parser/Cargo.tomlcrates/biome_html_parser/benches/html_parser.rscrates/biome_html_parser/src/parser.rscrates/biome_html_parser/tests/quick_test.rscrates/biome_html_parser/tests/spec_test.rscrates/biome_html_syntax/src/lib.rscrates/biome_js_analyze/Cargo.tomlcrates/biome_js_analyze/benches/js_analyzer.rscrates/biome_js_analyze/src/ast_utils.rscrates/biome_js_analyze/src/frameworks/playwright.rscrates/biome_js_analyze/src/frameworks/unit_tests.rscrates/biome_js_analyze/src/frameworks/vue/vue_component.rscrates/biome_js_analyze/src/lib.rscrates/biome_js_analyze/src/lint/complexity/no_useless_lone_block_statements.rscrates/biome_js_analyze/src/lint/complexity/no_useless_type_constraint.rscrates/biome_js_analyze/src/lint/complexity/use_arrow_function.rscrates/biome_js_analyze/src/lint/correctness/no_global_dirname_filename.rscrates/biome_js_analyze/src/lint/correctness/no_inner_declarations.rscrates/biome_js_analyze/src/lint/correctness/no_invalid_use_before_declaration.rscrates/biome_js_analyze/src/lint/correctness/no_undeclared_variables.rscrates/biome_js_analyze/src/lint/correctness/no_unused_imports.rscrates/biome_js_analyze/src/lint/correctness/no_unused_labels.rscrates/biome_js_analyze/src/lint/correctness/no_unused_variables.rscrates/biome_js_analyze/src/lint/correctness/no_vue_data_object_declaration.rscrates/biome_js_analyze/src/lint/correctness/no_vue_reserved_props.rscrates/biome_js_analyze/src/lint/nursery/no_conditional_expect.rscrates/biome_js_analyze/src/lint/nursery/no_undeclared_classes.rscrates/biome_js_analyze/src/lint/nursery/no_vue_import_compiler_macros.rscrates/biome_js_analyze/src/lint/nursery/use_explicit_return_type.rscrates/biome_js_analyze/src/lint/nursery/use_explicit_type.rscrates/biome_js_analyze/src/lint/nursery/use_vue_consistent_define_props_declaration.rscrates/biome_js_analyze/src/lint/style/no_enum.rscrates/biome_js_analyze/src/lint/style/no_jsx_literals.rscrates/biome_js_analyze/src/lint/style/no_vue_options_api.rscrates/biome_js_analyze/src/lint/style/use_const.rscrates/biome_js_analyze/src/lint/style/use_export_type.rscrates/biome_js_analyze/src/lint/style/use_import_type.rscrates/biome_js_analyze/src/lint/style/use_naming_convention.rscrates/biome_js_analyze/src/lint/style/use_readonly_class_properties.rscrates/biome_js_analyze/src/lint/style/use_vue_define_macros_order.rscrates/biome_js_analyze/src/lint/suspicious/no_assign_in_expressions.rscrates/biome_js_analyze/src/lint/suspicious/no_confusing_labels.rscrates/biome_js_analyze/src/lint/suspicious/no_document_import_in_page.rscrates/biome_js_analyze/src/lint/suspicious/no_evolving_types.rscrates/biome_js_analyze/src/lint/suspicious/no_head_import_in_document.rscrates/biome_js_analyze/src/lint/suspicious/no_implicit_any_let.rscrates/biome_js_analyze/src/lint/suspicious/no_redundant_use_strict.rscrates/biome_js_analyze/src/react/components.rscrates/biome_js_analyze/src/react/hooks.rscrates/biome_js_analyze/src/services/semantic.rscrates/biome_js_analyze/src/services/semantic_class.rscrates/biome_js_analyze/src/services/turborepo.rscrates/biome_js_analyze/src/suppressions.tests.rscrates/biome_js_analyze/src/syntax/correctness/no_type_only_import_attributes.rscrates/biome_js_analyze/src/utils.rscrates/biome_js_analyze/src/utils/tests.rscrates/biome_js_analyze/tests/quick_test.rscrates/biome_js_analyze/tests/spec_tests.rscrates/biome_js_formatter/Cargo.tomlcrates/biome_js_formatter/benches/js_formatter.rscrates/biome_js_formatter/src/context.rscrates/biome_js_formatter/src/js/expressions/arrow_function_expression.rscrates/biome_js_formatter/src/js/expressions/binary_expression.rscrates/biome_js_formatter/src/js/expressions/conditional_expression.rscrates/biome_js_formatter/src/js/expressions/in_expression.rscrates/biome_js_formatter/src/js/expressions/instanceof_expression.rscrates/biome_js_formatter/src/js/expressions/logical_expression.rscrates/biome_js_formatter/src/js/expressions/string_literal_expression.rscrates/biome_js_formatter/src/lib.rscrates/biome_js_formatter/src/parentheses.rscrates/biome_js_formatter/src/syntax_rewriter.rscrates/biome_js_formatter/src/ts/expressions/as_expression.rscrates/biome_js_formatter/src/ts/expressions/satisfies_expression.rscrates/biome_js_formatter/src/utils/conditional.rscrates/biome_js_formatter/src/utils/jsx.rscrates/biome_js_formatter/src/utils/string_utils.rscrates/biome_js_formatter/tests/language.rscrates/biome_js_formatter/tests/prettier_tests.rscrates/biome_js_formatter/tests/quick_test.rscrates/biome_js_formatter/tests/spec_test.rscrates/biome_js_parser/Cargo.tomlcrates/biome_js_parser/benches/js_parser.rscrates/biome_js_parser/src/lexer/tests.rscrates/biome_js_parser/src/lib.rscrates/biome_js_parser/src/parse.rscrates/biome_js_parser/src/parser.rscrates/biome_js_parser/src/state.rscrates/biome_js_parser/src/syntax/program.rscrates/biome_js_parser/src/syntax/stmt.rscrates/biome_js_parser/tests/spec_test.rscrates/biome_js_semantic/Cargo.tomlcrates/biome_js_semantic/src/semantic_model.rscrates/biome_js_semantic/src/semantic_model/closure.rscrates/biome_js_semantic/src/semantic_model/flavor.rscrates/biome_js_semantic/src/semantic_model/is_constant.rscrates/biome_js_semantic/src/semantic_model/tests.rscrates/biome_js_semantic/src/tests/assertions.rscrates/biome_js_semantic/src/tests/format.rscrates/biome_js_syntax/src/lib.rscrates/biome_js_transform/Cargo.tomlcrates/biome_js_transform/src/lib.rscrates/biome_js_transform/tests/spec_tests.rscrates/biome_js_type_info/Cargo.tomlcrates/biome_js_type_info/tests/utils.rscrates/biome_jsdoc_comment/Cargo.tomlcrates/biome_jsdoc_comment/src/jsdoc_comment.rscrates/biome_json_analyze/Cargo.tomlcrates/biome_json_analyze/benches/json_analyzer.rscrates/biome_json_analyze/src/lib.rscrates/biome_json_analyze/tests/compat_sortpkg_tests.rscrates/biome_json_analyze/tests/spec_tests.rscrates/biome_json_formatter/Cargo.tomlcrates/biome_json_formatter/src/context.rscrates/biome_json_formatter/tests/language.rscrates/biome_json_parser/Cargo.tomlcrates/biome_json_parser/src/parser.rscrates/biome_json_syntax/src/lib.rscrates/biome_languages/Cargo.tomlcrates/biome_languages/src/css.rscrates/biome_languages/src/graphql.rscrates/biome_languages/src/grit.rscrates/biome_languages/src/html.rscrates/biome_languages/src/javascript.rscrates/biome_languages/src/json.rscrates/biome_languages/src/lib.rscrates/biome_languages/src/md.rscrates/biome_languages/src/yaml.rscrates/biome_lsp/Cargo.tomlcrates/biome_lsp/src/handlers/text_document.rscrates/biome_markdown_formatter/Cargo.tomlcrates/biome_markdown_formatter/tests/language.rscrates/biome_markdown_syntax/src/lib.rscrates/biome_module_graph/Cargo.tomlcrates/biome_module_graph/benches/module_graph.rscrates/biome_module_graph/src/css_module_info/mod.rscrates/biome_module_graph/src/html_module_info/mod.rscrates/biome_module_graph/src/html_module_info/visitor.rscrates/biome_module_graph/src/lib.rscrates/biome_module_graph/tests/snap/mod.rscrates/biome_module_graph/tests/spec_tests.rscrates/biome_plugin_loader/Cargo.tomlcrates/biome_plugin_loader/src/analyzer_js_plugin.rscrates/biome_ruledoc_utils/Cargo.tomlcrates/biome_ruledoc_utils/src/codeblock.rscrates/biome_ruledoc_utils/src/lib.rscrates/biome_service/Cargo.tomlcrates/biome_service/src/diagnostics.rscrates/biome_service/src/embed/detector.rscrates/biome_service/src/embed/registry.rscrates/biome_service/src/embed/types.rscrates/biome_service/src/file_handlers/astro.rscrates/biome_service/src/file_handlers/css.rscrates/biome_service/src/file_handlers/html.rscrates/biome_service/src/file_handlers/html/parse_embedded_nodes.rscrates/biome_service/src/file_handlers/javascript.rscrates/biome_service/src/file_handlers/json.rscrates/biome_service/src/file_handlers/mod.rscrates/biome_service/src/file_handlers/svelte.rscrates/biome_service/src/file_handlers/vue.rscrates/biome_service/src/projects.rscrates/biome_service/src/settings.rscrates/biome_service/src/settings.tests.rscrates/biome_service/src/workspace.rscrates/biome_service/src/workspace.tests.rscrates/biome_service/src/workspace/document/mod.rscrates/biome_service/src/workspace/document/services/embedded_bindings.rscrates/biome_service/src/workspace/document/services/embedded_value_references.rscrates/biome_service/src/workspace/search/grit.rscrates/biome_service/src/workspace/search/mod.rscrates/biome_service/src/workspace/server.rscrates/biome_test_utils/Cargo.tomlcrates/biome_test_utils/src/lib.rscrates/biome_wasm/Cargo.tomlcrates/biome_wasm/build.rscrates/biome_yaml_formatter/Cargo.tomlcrates/biome_yaml_formatter/src/context.rscrates/biome_yaml_formatter/tests/language.rscrates/biome_yaml_syntax/src/lib.rsdeny.tomlfuzz/fuzz_targets/rome_common.rsfuzz/fuzz_targets/rome_format_d_ts.rsfuzz/fuzz_targets/rome_format_jsx.rsfuzz/fuzz_targets/rome_format_module.rsfuzz/fuzz_targets/rome_format_script.rsfuzz/fuzz_targets/rome_format_tsx.rsfuzz/fuzz_targets/rome_format_typescript.rsfuzz/fuzz_targets/rome_parse_d_ts.rsfuzz/fuzz_targets/rome_parse_jsx.rsfuzz/fuzz_targets/rome_parse_module.rsfuzz/fuzz_targets/rome_parse_script.rsfuzz/fuzz_targets/rome_parse_tsx.rsfuzz/fuzz_targets/rome_parse_typescript.rsxtask/codegen/Cargo.tomlxtask/codegen/src/generate_bindings.rsxtask/coverage/Cargo.tomlxtask/coverage/src/js/test262.rs
💤 Files with no reviewable changes (9)
- crates/biome_js_syntax/src/lib.rs
- crates/biome_grit_syntax/src/lib.rs
- crates/biome_module_graph/src/lib.rs
- crates/biome_yaml_syntax/src/lib.rs
- crates/biome_html_syntax/src/lib.rs
- crates/biome_json_syntax/src/lib.rs
- crates/biome_graphql_syntax/src/lib.rs
- crates/biome_markdown_syntax/src/lib.rs
- crates/biome_css_syntax/src/lib.rs
d9802eb to
23b8ce8
Compare
23b8ce8 to
5cd52d6
Compare
|
Going to merge this because it touches lot of files and it can get out of synch very fast. |
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Summary
This PR moves
DocumentFileSourceand all*FileSourceinto their own crate. They are self-contained, and they don't depend on any syntax crate.The reason why I want to move them:
DocumentFileSourcewill be part of the Salsa database, and it can't depend on syntax cratesImportant
To merge after v2.5
Test Plan
Green CI
Docs