Skip to content

Conversation

@tt-a1i
Copy link
Contributor

@tt-a1i tt-a1i commented Dec 19, 2025

Summary

Fixes #6783.

When running biome format, biome check, or biome lint with --stdin-file-path and the provided path doesn't exist on disk (i.e. it’s a virtual path), files.includes no longer causes the stdin content to be treated as ignored.

This keeps the existing behavior for real files (paths that exist on disk), and still respects VCS ignores / feature-specific ignores.

Test Plan

  • Added a new CLI snapshot test: format_stdin_formats_virtual_path_outside_includes
  • cargo test -p biome_cli --test main

AI Assistance Disclosure

This PR was written with assistance from OpenAI Codex CLI (used for review and iterative debugging).

@changeset-bot
Copy link

changeset-bot bot commented Dec 19, 2025

🦋 Changeset detected

Latest commit: 785732c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

That's a good idea! I didn't think about it! I believe it's fine to ship it as a patch, however we must update the docs and document this behaviour.

pub features: FeatureName,

#[serde(default, skip_serializing_if = "is_false")]
pub ignore_includes: bool,
Copy link
Member

Choose a reason for hiding this comment

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

Calling it ignore_includes is a bit reductive, because we also check VCS-ignored files. I suggest a more generic a more generic name e.g. skip_ignore_check

Copy link
Member

Choose a reason for hiding this comment

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

What do you think of this suggestion @tt-a1i ?

"@biomejs/biome": patch
---

Fixed [#6783](https://github.com/biomejs/biome/issues/6783): stdin formatting using `--stdin-file-path` is no longer blocked by `files.includes` when the provided path doesn't exist on disk.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Fixed [#6783](https://github.com/biomejs/biome/issues/6783): stdin formatting using `--stdin-file-path` is no longer blocked by `files.includes` when the provided path doesn't exist on disk.
Fixed [#6783](https://github.com/biomejs/biome/issues/6783): now, when a path is provided via `--stdin-file-path`, Biome checks whether the file exists within the current project. If the path doesn't exist, ignore checks - `files.includes` and VCS-ignore files - are skipped, and the file is handled.

What do you think of this suggestion? I think it is a bit clearer for our end users. Feel free to change it, but the idea is that we need to mention VCS too, and making the phrase generic towards stdin, not formatting.

Copy link
Member

Choose a reason for hiding this comment

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

@tt-a1i what do you think of this suggestion?

@tt-a1i
Copy link
Contributor Author

tt-a1i commented Dec 19, 2025

Good call — I’ve added a note to the --stdin-file-path docs in the CLI help text (check/lint/format) to clarify the interaction with files.includes:

  • virtual path (doesn’t exist on disk): files.includes won’t block stdin processing
  • existing path: files.includes applies as usual

Pushed in docs(cli): clarify stdin-file-path and files.includes.

If you’d prefer this documented somewhere else as well (e.g. the website docs), happy to follow up.

@ematipico
Copy link
Member

I still think we shouldn't mention files.includes specifically, because there's also VCS ignore files in the mix

@tt-a1i
Copy link
Contributor Author

tt-a1i commented Dec 19, 2025

Yep, that’s fair — mentioning files.includes alone is a bit misleading since VCS ignores can also make stdin behave as “ignored”.

I reworded the help text to be more generic (talks about ignore behaviour / project file set, and explicitly calls out VCS ignore files as an example), without singling out files.includes.

Pushed in docs(cli): clarify stdin-file-path ignore behavior.

@tt-a1i
Copy link
Contributor Author

tt-a1i commented Dec 19, 2025

FYI: I fixed the CI failures from the previous run:

  • cargo lint was failing on clippy::too_many_arguments / clippy::blocks_in_conditions in Projects::get_file_features (refactored to a params struct + simpler control flow)
  • help snapshots (check_help / format_help / lint_help) updated to match the updated --stdin-file-path wording

New CI run is in progress.

@tt-a1i tt-a1i marked this pull request as ready for review December 19, 2025 14:53
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 19, 2025

Walkthrough

Adds a boolean flag skip_ignore_check to file-feature query structs and call sites so virtual paths provided via --stdin-file-path can be handled when the path does not exist on disk or lies outside files.includes. Changes update CLI docs, stdin/traverse/process_file flows, LSP handlers, formatter tests and configs, and the service layer: Projects::get_file_features now accepts a consolidated GetFileFeaturesParams (including skip_ignore_check) and the ignore-evaluation logic was refactored to honour that flag.

Possibly related PRs

Suggested reviewers

  • ematipico
  • dyc3
  • siketyan

Pre-merge checks and finishing touches

✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarises the main change: allowing --stdin-file-path outside files.includes for virtual paths.
Description check ✅ Passed The description is well-related to the changeset, explaining the fix for issue #6783 with test plan details.
Linked Issues check ✅ Passed The PR addresses all coding requirements from #6783: skip ignore checks for virtual stdin paths while preserving checks for real files, updated CLI help text, and added test coverage.
Out of Scope Changes check ✅ Passed All changes directly support the objective to allow virtual stdin paths outside files.includes; no unrelated modifications detected.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 87e6fcf and 785732c.

📒 Files selected for processing (1)
  • crates/biome_service/src/projects.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/biome_service/src/projects.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: End-to-end tests
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Documentation
  • GitHub Check: Check Dependencies
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Test Node.js API
  • GitHub Check: Check JS Files
  • GitHub Check: autofix

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (2)
.changeset/warm-houses-switch.md (1)

5-5: Consider the suggested rewording from the previous review.

The past review comment suggests a clearer phrasing that mentions both files.includes and VCS-ignore files, which better reflects the actual behaviour of the fix.

crates/biome_service/src/workspace.rs (1)

124-125: Consider the naming suggestion from the previous review.

The past review comment suggests skip_ignore_check as a more generic name, since the flag affects both files.includes and VCS ignore files. If that discussion is still open, the alternative name might be clearer.

🧹 Nitpick comments (2)
crates/biome_lsp/src/handlers/analysis.rs (1)

75-82: LSP analysis correctly opts into include filtering; consider a tiny helper later

Using ignore_includes: false in both code_actions and fix_all keeps code‑action discovery and fix‑all aligned with the configured project file set and matches previous behaviour. If you find yourself touching these again, a small helper for constructing SupportsFeatureParams for LSP documents might trim a bit of repetition, but it’s strictly sugar.

Also applies to: 309-320

crates/biome_service/src/projects.rs (1)

18-26: Add rustdoc for the public struct and its fields.

This struct is now part of the public API. A brief doc comment explaining its purpose would help consumers, and the ignore_includes field in particular deserves a note on when it should be true (e.g. virtual stdin paths that don't exist on disk).

Suggested documentation
+/// Parameters for querying which features are supported for a given file.
 pub struct GetFileFeaturesParams<'a> {
+    /// The file system used for path existence checks.
     pub fs: &'a dyn FileSystem,
+    /// Key identifying the project containing the file.
     pub project_key: ProjectKey,
+    /// Path to the file being queried.
     pub path: &'a Utf8Path,
+    /// The set of features to check support for.
     pub features: FeatureName,
+    /// The detected or declared language of the file.
     pub language: DocumentFileSource,
+    /// Capabilities of the file handler for this language.
     pub capabilities: &'a Capabilities,
+    /// When `true`, bypasses `files.includes` filtering (useful for virtual
+    /// paths such as stdin content that may not exist on disk). VCS ignores
+    /// and per-feature ignores still apply.
     pub ignore_includes: bool,
 }

As per coding guidelines, rustdoc should be updated when adding new features in Rust crates.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e30d752 and 0d56a71.

⛔ Files ignored due to path filters (5)
  • crates/biome_cli/tests/snapshots/main_commands_check/check_help.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_format/format_help.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_format/format_stdin_formats_virtual_path_outside_includes.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_lint/lint_help.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
📒 Files selected for processing (14)
  • .changeset/warm-houses-switch.md (1 hunks)
  • crates/biome_cli/src/commands/mod.rs (3 hunks)
  • crates/biome_cli/src/execute/process_file.rs (1 hunks)
  • crates/biome_cli/src/execute/std_in.rs (2 hunks)
  • crates/biome_cli/src/execute/traverse.rs (1 hunks)
  • crates/biome_cli/tests/commands/format.rs (2 hunks)
  • crates/biome_cli/tests/configs.rs (1 hunks)
  • crates/biome_formatter_test/src/spec.rs (1 hunks)
  • crates/biome_lsp/src/handlers/analysis.rs (2 hunks)
  • crates/biome_lsp/src/handlers/formatting.rs (3 hunks)
  • crates/biome_lsp/src/session.rs (1 hunks)
  • crates/biome_service/src/projects.rs (3 hunks)
  • crates/biome_service/src/workspace.rs (1 hunks)
  • crates/biome_service/src/workspace/server.rs (2 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
crates/**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update inline rustdoc documentation for rules, assists, and their options when adding new features or changing existing features in Rust crates

Files:

  • crates/biome_cli/tests/configs.rs
  • crates/biome_cli/src/execute/process_file.rs
  • crates/biome_service/src/workspace.rs
  • crates/biome_formatter_test/src/spec.rs
  • crates/biome_lsp/src/handlers/formatting.rs
  • crates/biome_cli/src/execute/traverse.rs
  • crates/biome_lsp/src/handlers/analysis.rs
  • crates/biome_service/src/workspace/server.rs
  • crates/biome_service/src/projects.rs
  • crates/biome_lsp/src/session.rs
  • crates/biome_cli/src/commands/mod.rs
  • crates/biome_cli/tests/commands/format.rs
  • crates/biome_cli/src/execute/std_in.rs
crates/biome_service/src/workspace*.rs

📄 CodeRabbit inference engine (crates/biome_service/CONTRIBUTING.md)

Implement the Workspace trait in the Biome Service to manage internal state of projects, including open documents, project layout instances, and module graph instances

Files:

  • crates/biome_service/src/workspace.rs
crates/biome_service/src/workspace/server.rs

📄 CodeRabbit inference engine (crates/biome_service/CONTRIBUTING.md)

Use WorkspaceServer implementation for maintaining workspace state in daemon mode and CLI daemonless mode

Files:

  • crates/biome_service/src/workspace/server.rs
.changeset/*.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Write changesets that are concise (1-3 sentences), user-focused, use past tense for actions taken and present tense for Biome behavior, include code examples for rules, and end sentences with periods

Files:

  • .changeset/warm-houses-switch.md
🧠 Learnings (41)
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/Cargo.toml : Include development dependencies in `Cargo.toml` for formatter tests: `biome_formatter_test`, `biome_<language>_factory`, `biome_<language>_parser`, `biome_parser`, `biome_service`, `countme`, `iai`, `quickcheck`, `quickcheck_macros`, and `tests_macros`

Applied to files:

  • crates/biome_cli/tests/configs.rs
  • crates/biome_service/src/workspace.rs
  • crates/biome_formatter_test/src/spec.rs
  • crates/biome_cli/src/execute/traverse.rs
  • crates/biome_cli/tests/commands/format.rs
  • crates/biome_cli/src/execute/std_in.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `full_options` code block property for complete biome.json configuration snippets in documentation

Applied to files:

  • crates/biome_cli/tests/configs.rs
  • crates/biome_cli/src/execute/process_file.rs
  • crates/biome_formatter_test/src/spec.rs
  • crates/biome_lsp/src/handlers/formatting.rs
  • crates/biome_cli/src/execute/traverse.rs
  • crates/biome_service/src/workspace/server.rs
  • crates/biome_service/src/projects.rs
  • crates/biome_lsp/src/session.rs
  • crates/biome_cli/src/commands/mod.rs
  • crates/biome_cli/tests/commands/format.rs
  • crates/biome_cli/src/execute/std_in.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/language_kind.rs : Add a new language prefix to the `LANGUAGE_PREFIXES` constant in `language_kind.rs` file

Applied to files:

  • crates/biome_cli/tests/configs.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Lines prefixed with `#` in rule documentation code examples will be hidden from output

Applied to files:

  • crates/biome_cli/tests/configs.rs
  • crates/biome_cli/src/execute/process_file.rs
  • crates/biome_lsp/src/handlers/formatting.rs
  • crates/biome_cli/src/execute/traverse.rs
  • crates/biome_cli/src/commands/mod.rs
  • crates/biome_cli/tests/commands/format.rs
  • crates/biome_cli/src/execute/std_in.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `options` code block property for rule-specific configuration snippets in documentation

Applied to files:

  • crates/biome_cli/tests/configs.rs
  • crates/biome_lsp/src/handlers/formatting.rs
  • crates/biome_lsp/src/session.rs
  • crates/biome_cli/src/commands/mod.rs
  • crates/biome_cli/tests/commands/format.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `ignore` code block property to exclude documentation code examples from automatic validation

Applied to files:

  • crates/biome_cli/tests/configs.rs
  • crates/biome_cli/src/execute/process_file.rs
  • crates/biome_service/src/workspace.rs
  • crates/biome_formatter_test/src/spec.rs
  • crates/biome_lsp/src/handlers/formatting.rs
  • crates/biome_cli/src/execute/traverse.rs
  • crates/biome_lsp/src/handlers/analysis.rs
  • crates/biome_service/src/projects.rs
  • crates/biome_lsp/src/session.rs
  • crates/biome_cli/src/commands/mod.rs
  • crates/biome_cli/src/execute/std_in.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Prefix line with `#` in documentation code examples sparingly; prefer concise complete snippets

Applied to files:

  • crates/biome_cli/tests/configs.rs
  • crates/biome_cli/src/commands/mod.rs
  • crates/biome_cli/tests/commands/format.rs
📚 Learning: 2025-12-04T13:29:49.287Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8291
File: crates/biome_html_formatter/tests/specs/prettier/vue/html-vue/elastic-header.html:10-10
Timestamp: 2025-12-04T13:29:49.287Z
Learning: Files under `crates/biome_html_formatter/tests/specs/prettier` are test fixtures synced from Prettier and should not receive detailed code quality reviews (e.g., HTTP vs HTTPS, formatting suggestions, etc.). These files are test data meant to validate formatter behavior and should be preserved as-is.

Applied to files:

  • crates/biome_cli/tests/configs.rs
  • crates/biome_formatter_test/src/spec.rs
  • crates/biome_cli/tests/commands/format.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `file=<path>` property for multi-file rule documentation examples

Applied to files:

  • crates/biome_cli/tests/configs.rs
  • crates/biome_cli/src/execute/process_file.rs
  • crates/biome_service/src/workspace/server.rs
  • crates/biome_service/src/projects.rs
  • crates/biome_cli/src/commands/mod.rs
  • crates/biome_cli/src/execute/std_in.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/context.rs : Define `<Language>FormatContext` struct in a `context.rs` file containing `comments` and `source_map` fields, implementing `FormatContext` and `CstFormatContext` traits

Applied to files:

  • crates/biome_cli/tests/configs.rs
  • crates/biome_lsp/src/handlers/formatting.rs
  • crates/biome_cli/tests/commands/format.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `deny_unknown_fields` in serde derive macro for rule options

Applied to files:

  • crates/biome_cli/src/execute/process_file.rs
  • crates/biome_service/src/workspace.rs
  • crates/biome_formatter_test/src/spec.rs
  • crates/biome_lsp/src/handlers/formatting.rs
  • crates/biome_cli/src/execute/traverse.rs
  • crates/biome_lsp/src/handlers/analysis.rs
  • crates/biome_lsp/src/session.rs
  • crates/biome_cli/src/execute/std_in.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Wrap rule options fields in `Option<>` to properly track set and unset options during merge

Applied to files:

  • crates/biome_cli/src/execute/process_file.rs
  • crates/biome_service/src/workspace.rs
  • crates/biome_formatter_test/src/spec.rs
  • crates/biome_lsp/src/handlers/formatting.rs
  • crates/biome_cli/src/execute/traverse.rs
  • crates/biome_cli/src/execute/std_in.rs
📚 Learning: 2025-12-12T10:11:05.564Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-12T10:11:05.564Z
Learning: Applies to crates/**/*.rs : Update inline rustdoc documentation for rules, assists, and their options when adding new features or changing existing features in Rust crates

Applied to files:

  • crates/biome_cli/src/execute/process_file.rs
  • crates/biome_lsp/src/handlers/formatting.rs
  • crates/biome_service/src/workspace/server.rs
  • crates/biome_cli/src/commands/mod.rs
  • crates/biome_cli/tests/commands/format.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation code blocks should be ordered as language, expect_diagnostic, options/full_options/use_options, ignore, file

Applied to files:

  • crates/biome_cli/src/execute/process_file.rs
  • crates/biome_lsp/src/session.rs
  • crates/biome_cli/src/commands/mod.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Implement `Merge` trait for rule options to support configuration inheritance

Applied to files:

  • crates/biome_cli/src/execute/process_file.rs
  • crates/biome_cli/src/execute/traverse.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Check if a variable is global using the semantic model to avoid false positives

Applied to files:

  • crates/biome_cli/src/execute/process_file.rs
  • crates/biome_cli/src/execute/traverse.rs
  • crates/biome_lsp/src/handlers/analysis.rs
  • crates/biome_lsp/src/session.rs
  • crates/biome_cli/src/execute/std_in.rs
📚 Learning: 2025-11-24T18:06:12.048Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.048Z
Learning: Applies to crates/biome_service/src/workspace*.rs : Implement the Workspace trait in the Biome Service to manage internal state of projects, including open documents, project layout instances, and module graph instances

Applied to files:

  • crates/biome_service/src/workspace.rs
  • crates/biome_formatter_test/src/spec.rs
  • crates/biome_service/src/workspace/server.rs
  • crates/biome_service/src/projects.rs
  • crates/biome_lsp/src/session.rs
  • crates/biome_cli/src/execute/std_in.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Set `recommended` field to `false` for new rules in the nursery group

Applied to files:

  • crates/biome_service/src/workspace.rs
  • crates/biome_lsp/src/handlers/analysis.rs
  • crates/biome_lsp/src/session.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Distinguish between `TypeData::Unknown` and `TypeData::UnknownKeyword` to measure inference effectiveness versus explicit user-provided unknown types

Applied to files:

  • crates/biome_service/src/workspace.rs
  • crates/biome_cli/src/execute/traverse.rs
  • crates/biome_cli/src/execute/std_in.rs
📚 Learning: 2025-11-24T18:06:12.048Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.048Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Implement watcher tests for workspace methods in watcher.tests.rs and end-to-end tests in LSP tests

Applied to files:

  • crates/biome_formatter_test/src/spec.rs
  • crates/biome_service/src/workspace/server.rs
  • crates/biome_cli/src/execute/std_in.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/spec_tests.rs : Use the `tests_macros::gen_tests!` macro in `spec_tests.rs` to generate test functions for each specification file matching the pattern `tests/specs/<language>/**/*.<ext>`

Applied to files:

  • crates/biome_formatter_test/src/spec.rs
  • crates/biome_cli/tests/commands/format.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/language.rs : Implement `TestFormatLanguage` trait in `tests/language.rs` for the formatter's test language

Applied to files:

  • crates/biome_formatter_test/src/spec.rs
  • crates/biome_cli/tests/commands/format.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `version` field to `next` in `declare_lint_rule!` macro

Applied to files:

  • crates/biome_lsp/src/handlers/formatting.rs
  • crates/biome_lsp/src/session.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Add `issue_number` field to `declare_lint_rule!` macro for work-in-progress rules

Applied to files:

  • crates/biome_lsp/src/handlers/formatting.rs
  • crates/biome_lsp/src/handlers/analysis.rs
  • crates/biome_lsp/src/session.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Assist rules should detect refactoring opportunities and emit code action signals

Applied to files:

  • crates/biome_cli/src/execute/traverse.rs
  • crates/biome_lsp/src/handlers/analysis.rs
  • crates/biome_service/src/workspace/server.rs
  • crates/biome_service/src/projects.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Implement `action` function in Rule trait to provide code actions

Applied to files:

  • crates/biome_lsp/src/handlers/analysis.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Specify `fix_kind: FixKind::Safe` in `declare_lint_rule!` for safe code actions

Applied to files:

  • crates/biome_lsp/src/handlers/analysis.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Specify `fix_kind: FixKind::Unsafe` in `declare_lint_rule!` for unsafe code actions

Applied to files:

  • crates/biome_lsp/src/handlers/analysis.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set rule severity to `info` for code action rules in analyzer

Applied to files:

  • crates/biome_lsp/src/handlers/analysis.rs
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
Repo: biomejs/biome PR: 7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.

Applied to files:

  • .changeset/warm-houses-switch.md
📚 Learning: 2025-12-12T10:11:05.564Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-12T10:11:05.564Z
Learning: Create a changeset for user-facing bug fixes and features using `just new-changeset`, selecting appropriate packages and change type (`major`, `minor`, or `patch`)

Applied to files:

  • .changeset/warm-houses-switch.md
📚 Learning: 2025-09-25T12:32:59.003Z
Learnt from: arendjr
Repo: biomejs/biome PR: 7593
File: crates/biome_service/src/workspace/server.rs:1306-1306
Timestamp: 2025-09-25T12:32:59.003Z
Learning: In the biomejs/biome project, do not flag compilation errors during code review as they are handled by the existing test infrastructure and CI. Focus on other code quality aspects instead.

Applied to files:

  • .changeset/warm-houses-switch.md
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation must include `## Options` section if the rule has options

Applied to files:

  • crates/biome_cli/src/commands/mod.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : The first paragraph of rule documentation must be a single line describing what the rule does

Applied to files:

  • crates/biome_cli/src/commands/mod.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Import the `FormatNode` trait and implement it for your Node when creating formatters in biome_js_formatter

Applied to files:

  • crates/biome_cli/tests/commands/format.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/lib.rs : Expose a public `format_node` function that accepts formatting options and a root syntax node, returning a `FormatResult<Formatted<Context>>` with appropriate documentation

Applied to files:

  • crates/biome_cli/tests/commands/format.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/tests/specs/**/*.jsonc : Use `.jsonc` files to contain arrays of code snippet strings for snapshot tests

Applied to files:

  • crates/biome_cli/tests/commands/format.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `use_options` code block property for code examples that follow an options configuration in documentation

Applied to files:

  • crates/biome_cli/tests/commands/format.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Use the `dbg_write!` macro to debug formatter output instead of other logging methods

Applied to files:

  • crates/biome_cli/tests/commands/format.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Create specification test files in `tests/specs/<language>/` directories with one or more test files; use `cargo insta accept` or `cargo insta review` to accept/reject snapshots

Applied to files:

  • crates/biome_cli/tests/commands/format.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/local_inference.rs : Implement local inference in dedicated modules to derive type definitions from expressions without context of surrounding scopes

Applied to files:

  • crates/biome_cli/src/execute/std_in.rs
🧬 Code graph analysis (1)
crates/biome_cli/src/execute/std_in.rs (1)
crates/biome_service/src/workspace/server.rs (2)
  • file_features (1173-1196)
  • new (119-141)
🔇 Additional comments (18)
crates/biome_cli/src/execute/process_file.rs (1)

139-139: LGTM!

Correctly passes ignore_includes: false for regular file processing, ensuring that files.includes rules apply as expected.

crates/biome_formatter_test/src/spec.rs (1)

73-73: LGTM!

Correctly passes ignore_includes: false for formatter test specs, maintaining normal include/exclude behaviour in tests.

crates/biome_cli/src/commands/mod.rs (3)

184-188: LGTM!

The documentation clearly explains the behaviour for virtual paths with --stdin-file-path, noting both the relaxed includes requirement and the continuing applicability of ignore rules.


295-299: LGTM!

Consistent documentation across the lint command.


358-362: LGTM!

Consistent documentation across the format command.

crates/biome_cli/tests/configs.rs (1)

36-47: LGTM!

New test configuration constant to support exercising stdin formatting with files.includes rules.

crates/biome_service/src/workspace.rs (1)

112-114: LGTM!

Helper function for serde serialisation.

crates/biome_lsp/src/handlers/formatting.rs (3)

41-41: LGTM!

Correctly passes ignore_includes: false for LSP formatting, maintaining normal include/exclude behaviour.


111-111: LGTM!

Consistent with the format function.


204-204: LGTM!

Consistent across all LSP formatting operations.

crates/biome_cli/src/execute/std_in.rs (3)

41-41: LGTM!

Clever logic: virtual paths (non-existent on disk) set ignore_includes: true to bypass files.includes filtering, whilst real paths respect the normal rules.


50-50: LGTM!

Correctly threads the computed flag through to the formatter feature query.


132-132: LGTM!

Correctly threads the flag through to the lint/check feature query.

crates/biome_lsp/src/session.rs (1)

419-426: Explicit ignore_includes here correctly preserves LSP diagnostic behaviour

Wiring ignore_includes: false through SupportsFeatureParams keeps diagnostics subject to the configured file set while adapting to the new API. No issues spotted.

crates/biome_cli/src/execute/traverse.rs (1)

575-580: Correct default for ignore_includes during filesystem traversal

Passing ignore_includes: false here matches the existing traversal semantics: real files are still filtered by the configured include set, while the new flag is available for stdin/virtual paths elsewhere. Looks good.

crates/biome_cli/tests/commands/format.rs (1)

2-4: New stdin regression test nicely captures the virtual‑path case

Importing CONFIG_FILES_INCLUDES_EXCLUDES_STDIN_PATH and the new format_stdin_formats_virtual_path_outside_includes test together give solid coverage for the bug this PR fixes: stdin formatting with a non‑existent path that wouldn’t match the include set. The test structure mirrors the existing stdin tests and looks spot‑on.

Also applies to: 1213-1254

crates/biome_service/src/workspace/server.rs (1)

13-13: Clean file_features refactor with correct ignore_includes threading

The switch to GetFileFeaturesParams is tidy: you pass fs, project_key, path, features, language, capabilities, and crucially ignore_includes: params.ignore_includes, so all existing behaviour is preserved and the new flag is available to callers that care (e.g. stdin/virtual paths). The added import matches the new usage. Nicely wired.

Also applies to: 1187-1195

crates/biome_service/src/projects.rs (1)

248-282: LGTM — logic correctly distinguishes virtual vs. real paths.

The branching on ignore_includes neatly separates behaviour:

  • Virtual paths (ignore_includes: true): only VCS ignores apply.
  • Real paths (ignore_includes: false): full files.includes + VCS check via is_ignored_by_top_level_config.

Per-feature ignores are evaluated afterwards regardless, preserving feature-specific overrides. Nicely done.

@tt-a1i tt-a1i requested a review from ematipico December 23, 2025 02:08
@tt-a1i
Copy link
Contributor Author

tt-a1i commented Dec 23, 2025

done — renamed to skip_ignore_check and updated the changeset wording. thanks for the suggestions!

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
crates/biome_service/src/projects.rs (1)

18-26: Add rustdoc comments to the new public struct.

The GetFileFeaturesParams struct is public and consolidates several parameters. Consider adding rustdoc comments, particularly for skip_ignore_check to explain when it should be true (e.g., for virtual stdin paths not on disk).

📝 Example documentation
+/// Parameters for querying file features.
+///
+/// This struct consolidates all parameters needed to determine which features
+/// (formatting, linting, etc.) are supported for a given file path.
 pub struct GetFileFeaturesParams<'a> {
     pub fs: &'a dyn FileSystem,
     pub project_key: ProjectKey,
     pub path: &'a Utf8Path,
     pub features: FeatureName,
     pub language: DocumentFileSource,
     pub capabilities: &'a Capabilities,
+    /// When `true`, skips `files.includes` and ancestor checks, but still respects
+    /// VCS ignores. Used for virtual paths (e.g., `--stdin-file-path`) that don't
+    /// exist on disk.
     pub skip_ignore_check: bool,
 }
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0d56a71 and 5dbf37a.

⛔ Files ignored due to path filters (1)
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
📒 Files selected for processing (11)
  • .changeset/warm-houses-switch.md
  • crates/biome_cli/src/execute/process_file.rs
  • crates/biome_cli/src/execute/std_in.rs
  • crates/biome_cli/src/execute/traverse.rs
  • crates/biome_formatter_test/src/spec.rs
  • crates/biome_lsp/src/handlers/analysis.rs
  • crates/biome_lsp/src/handlers/formatting.rs
  • crates/biome_lsp/src/session.rs
  • crates/biome_service/src/projects.rs
  • crates/biome_service/src/workspace.rs
  • crates/biome_service/src/workspace/server.rs
🚧 Files skipped from review as they are similar to previous changes (8)
  • crates/biome_cli/src/execute/process_file.rs
  • crates/biome_formatter_test/src/spec.rs
  • crates/biome_cli/src/execute/std_in.rs
  • crates/biome_cli/src/execute/traverse.rs
  • .changeset/warm-houses-switch.md
  • crates/biome_lsp/src/handlers/analysis.rs
  • crates/biome_service/src/workspace.rs
  • crates/biome_service/src/workspace/server.rs
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.rs: Use inline rustdoc documentation for rules, assists, and their options
Use the dbg!() macro for debugging output in Rust tests and code
Use doc tests (doctest) format with code blocks in rustdoc comments; ensure assertions pass in tests

Files:

  • crates/biome_lsp/src/session.rs
  • crates/biome_lsp/src/handlers/formatting.rs
  • crates/biome_service/src/projects.rs
🧠 Learnings (21)
📚 Learning: 2025-11-24T18:06:12.048Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.048Z
Learning: Applies to crates/biome_service/src/workspace*.rs : Implement the Workspace trait in the Biome Service to manage internal state of projects, including open documents, project layout instances, and module graph instances

Applied to files:

  • crates/biome_lsp/src/session.rs
  • crates/biome_service/src/projects.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `ignore` code block property to exclude documentation code examples from automatic validation

Applied to files:

  • crates/biome_lsp/src/session.rs
  • crates/biome_service/src/projects.rs
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Fields with #[advice] or #[verbose_advice] attributes must implement the Advices trait to record advices on the diagnostic

Applied to files:

  • crates/biome_lsp/src/session.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `version` field to `next` in `declare_lint_rule!` macro

Applied to files:

  • crates/biome_lsp/src/session.rs
  • crates/biome_lsp/src/handlers/formatting.rs
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Use helper types from the biome_diagnostics::v2 module (CodeFrameAdvice, CommandAdvice, DiffAdvice, LogAdvice) or implement the Advices trait yourself for custom advice handling

Applied to files:

  • crates/biome_lsp/src/session.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `full_options` code block property for complete biome.json configuration snippets in documentation

Applied to files:

  • crates/biome_lsp/src/session.rs
  • crates/biome_service/src/projects.rs
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Ensure the type implementing Diagnostic derives Debug

Applied to files:

  • crates/biome_lsp/src/session.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Add `issue_number` field to `declare_lint_rule!` macro for work-in-progress rules

Applied to files:

  • crates/biome_lsp/src/session.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Valid code examples in rule documentation should not trigger any diagnostics

Applied to files:

  • crates/biome_lsp/src/session.rs
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Implement the Diagnostic trait on types, or use the #[derive(Diagnostic)] procedural macro to implement the trait. Configure category, severity, description, message, location, and tags using the #[diagnostic] attribute

Applied to files:

  • crates/biome_lsp/src/session.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/context.rs : Define `<Language>FormatContext` struct in a `context.rs` file containing `comments` and `source_map` fields, implementing `FormatContext` and `CstFormatContext` traits

Applied to files:

  • crates/biome_lsp/src/handlers/formatting.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When formatting AST nodes, use mandatory tokens from the AST instead of hardcoding token strings (e.g., use `node.l_paren_token().format()` instead of `token("(")`)

Applied to files:

  • crates/biome_lsp/src/handlers/formatting.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For tokens that are not mandatory, use helper functions instead of hardcoding

Applied to files:

  • crates/biome_lsp/src/handlers/formatting.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/language.rs : Implement `TestFormatLanguage` trait in `tests/language.rs` for the formatter's test language

Applied to files:

  • crates/biome_lsp/src/handlers/formatting.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `deny_unknown_fields` in serde derive macro for rule options

Applied to files:

  • crates/biome_lsp/src/handlers/formatting.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Use `ConditionalParsedSyntax` for syntax that is only valid in specific contexts (e.g., strict mode, file types, language versions) and call `or_invalid_to_bogus()` to convert to a bogus node if not supported

Applied to files:

  • crates/biome_lsp/src/handlers/formatting.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to 'fix' the code; if a token/node is known to be mandatory but is missing, return `None` instead

Applied to files:

  • crates/biome_lsp/src/handlers/formatting.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Assist rules should detect refactoring opportunities and emit code action signals

Applied to files:

  • crates/biome_lsp/src/handlers/formatting.rs
  • crates/biome_service/src/projects.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Wrap rule options fields in `Option<>` to properly track set and unset options during merge

Applied to files:

  • crates/biome_lsp/src/handlers/formatting.rs
  • crates/biome_service/src/projects.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `file=<path>` property for multi-file rule documentation examples

Applied to files:

  • crates/biome_service/src/projects.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `options` code block property for rule-specific configuration snippets in documentation

Applied to files:

  • crates/biome_service/src/projects.rs
🧬 Code graph analysis (1)
crates/biome_service/src/projects.rs (2)
crates/biome_service/src/workspace.rs (4)
  • is_ignored (327-329)
  • is_ignored (543-545)
  • fs (1529-1529)
  • file_features (1453-1456)
crates/biome_service/src/workspace/server.rs (4)
  • is_ignored (2236-2244)
  • fs (2133-2135)
  • fs (2221-2223)
  • file_features (1173-1196)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: Test Node.js API
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Check Dependencies
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: End-to-end tests
  • GitHub Check: Documentation
  • GitHub Check: autofix
  • GitHub Check: Check JS Files
🔇 Additional comments (4)
crates/biome_lsp/src/session.rs (1)

421-426: LGTM! Straightforward parameter addition.

The addition of skip_ignore_check: false maintains existing behaviour whilst supporting the new virtual stdin path feature.

crates/biome_lsp/src/handlers/formatting.rs (1)

37-42: LGTM! Consistent parameter additions across formatting handlers.

All three formatting functions correctly add skip_ignore_check: false, ensuring LSP formatting continues to respect ignore rules whilst enabling the new CLI virtual path feature.

Also applies to: 107-112, 200-205

crates/biome_service/src/projects.rs (2)

212-223: LGTM! Clean parameter consolidation.

The refactored signature using GetFileFeaturesParams improves maintainability. Destructuring in the parameter position is idiomatic and keeps the function body clean.


248-283: LGTM! Ignore logic correctly implements virtual path handling.

The refactored ignore logic properly distinguishes between:

  • skip_ignore_check=true: VCS-only (for virtual stdin paths)
  • skip_ignore_check=false: Full checks including files.includes and ancestors (existing behaviour)

Both paths correctly preserve feature-specific ignore checks. The nested conditional is complex but correct.

💡 Optional: Consider adding an inline comment

For future maintainers, a brief comment at line 249 could clarify the purpose:

let is_ignored = {
    // When skip_ignore_check is true (e.g., for --stdin-file-path with virtual paths),
    // skip files.includes and ancestor traversal, but still respect VCS ignores.
    let is_ignored_by_top_level_config = if skip_ignore_check {

This is entirely optional—the code is clear from context.

@tt-a1i tt-a1i force-pushed the fix-stdin-file-path-virtual-includes branch from 5dbf37a to bc1ac0a Compare December 23, 2025 13:56
The files.includes check is skipped for non-existent stdin paths,
but VCS ignore rules still apply (as documented in CLI help).
Add nursery group info message to diagnostics.
@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Dec 23, 2025
Comment on lines 184 to 187
/// The provided path may also affect whether the input is treated as
/// ignored. If the path doesn't exist on disk (virtual path), Biome
/// won't require it to be part of the project file set, but ignore rules
/// may still apply (e.g. VCS ignore files).
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/// The provided path may also affect whether the input is treated as
/// ignored. If the path doesn't exist on disk (virtual path), Biome
/// won't require it to be part of the project file set, but ignore rules
/// may still apply (e.g. VCS ignore files).
/// If the provided path doesn't exist in the project, Biome doesn't check if
/// it's ignored (VCS, `files.includes`, etc.).

Comment on lines 295 to 298
/// The provided path may also affect whether the input is treated as
/// ignored. If the path doesn't exist on disk (virtual path), Biome
/// won't require it to be part of the project file set, but ignore rules
/// may still apply (e.g. VCS ignore files).
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/// The provided path may also affect whether the input is treated as
/// ignored. If the path doesn't exist on disk (virtual path), Biome
/// won't require it to be part of the project file set, but ignore rules
/// may still apply (e.g. VCS ignore files).
/// If the provided path doesn't exist in the project, Biome doesn't check if
/// it's ignored (VCS, `files.includes`, etc.).

Comment on lines 358 to 361
/// The provided path may also affect whether the input is treated as
/// ignored. If the path doesn't exist on disk (virtual path), Biome
/// won't require it to be part of the project file set, but ignore rules
/// may still apply (e.g. VCS ignore files).
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/// The provided path may also affect whether the input is treated as
/// ignored. If the path doesn't exist on disk (virtual path), Biome
/// won't require it to be part of the project file set, but ignore rules
/// may still apply (e.g. VCS ignore files).
/// If the provided path doesn't exist in the project, Biome doesn't check if
/// it's ignored (VCS, `files.includes`, etc.).

Comment on lines 249 to 253
let is_ignored_by_top_level_config = if skip_ignore_check {
project_data
.root_settings
.vcs_settings
.is_ignored(path, Some(project_data.path.as_path()))
Copy link
Member

Choose a reason for hiding this comment

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

Why did we change the initial proposed logic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why did we change the initial proposed logic?

Right now, when --stdin-file-path points to a path that doesn’t exist on disk, we only bypass
the files.includes “file set” check — we still apply VCS ignore (and per-feature ignore) so
--stdin-file-path can’t be used to bypass ignore rules.

That’s why I didn’t take the doc suggestion as-is: “doesn’t check if it’s ignored (VCS,
includes, etc.)” would be inaccurate with the current behavior.

We changed from the initial “skip ignore entirely” idea because the goal of #6783 was “don’t
let files.includes block virtual stdin paths”, not “ignore .gitignore”.

If you’d rather have the stronger behavior (skip VCS/feature ignores too for virtual paths), I
can adjust the implementation + tests + changeset — just want to confirm the intended
semantics first.

Copy link
Member

Choose a reason for hiding this comment

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

It would be very hard to justify to the users why we skip files.includes but we don't skip VCS ignore files. Just because a user used one way to ignore files, doesn't exclude the use of VCS ignore files. Both tools achieve the same objective - ignoring files.

So yes, we should skip both checks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would be very hard to justify to the users why we skip files.includes but we don't skip VCS ignore files. Just because a user used one way to ignore files, doesn't exclude the use of VCS ignore files. Both tools achieve the same objective - ignoring files.

So yes, we should skip both checks.

Makes sense — updated. When skip_ignore_check is true we now skip the whole ignore block (both
files.includes and VCS ignore). Also updated the CLI help text + changeset to match.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
crates/biome_service/src/projects.rs (1)

248-278: Consider extracting the per-feature ignore logic.

Lines 255-260 duplicate logic from the is_ignored method (lines 201-206). Extracting this into a helper function (similar to is_ignored_by_top_level_config) would reduce duplication and make future maintenance easier.

💡 Example helper function
#[inline]
fn is_ignored_by_features(
    project_data: &ProjectData,
    path: &Utf8Path,
    features: FeatureName,
) -> bool {
    !features.is_empty()
        && features.iter().all(|feature| {
            project_data
                .root_settings
                .is_path_ignored_for_feature(path, feature)
        })
}

Then use it in both is_ignored and get_file_features:

let is_ignored_by_features = is_ignored_by_features(project_data, path, features);
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 18eeba2 and 87e6fcf.

⛔ Files ignored due to path filters (4)
  • crates/biome_cli/tests/snapshots/main_commands_check/check_help.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_format/format_help.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_lint/lint_help.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/noUndeclaredEnvVars/invalid.js.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (3)
  • .changeset/warm-houses-switch.md
  • crates/biome_cli/src/commands/mod.rs
  • crates/biome_service/src/projects.rs
✅ Files skipped from review due to trivial changes (1)
  • .changeset/warm-houses-switch.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/biome_cli/src/commands/mod.rs
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.rs: Use inline rustdoc documentation for rules, assists, and their options
Use the dbg!() macro for debugging output in Rust tests and code
Use doc tests (doctest) format with code blocks in rustdoc comments; ensure assertions pass in tests

Files:

  • crates/biome_service/src/projects.rs
🧠 Learnings (1)
📚 Learning: 2025-11-24T18:06:12.048Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.048Z
Learning: Applies to crates/biome_service/src/workspace*.rs : Implement the Workspace trait in the Biome Service to manage internal state of projects, including open documents, project layout instances, and module graph instances

Applied to files:

  • crates/biome_service/src/projects.rs
🧬 Code graph analysis (1)
crates/biome_service/src/projects.rs (6)
packages/@biomejs/js-api/src/wasm.ts (1)
  • ProjectKey (2-2)
crates/biome_service/src/workspace.rs (4)
  • is_ignored (327-329)
  • is_ignored (543-545)
  • fs (1538-1538)
  • file_features (1462-1465)
crates/biome_service/src/workspace/server.rs (4)
  • is_ignored (2285-2293)
  • fs (2182-2184)
  • fs (2270-2272)
  • file_features (1220-1243)
crates/biome_service/src/settings.rs (2)
  • is_ignored (769-774)
  • is_ignored (852-889)
crates/biome_service/src/scanner/workspace_bridges.rs (6)
  • is_ignored (27-33)
  • is_ignored (120-125)
  • is_ignored (224-236)
  • fs (15-15)
  • fs (107-107)
  • fs (200-202)
crates/biome_service/src/workspace/client.rs (2)
  • fs (210-212)
  • file_features (138-143)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Check JS Files
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Check Dependencies
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Documentation
  • GitHub Check: autofix
  • GitHub Check: Test Node.js API
🔇 Additional comments (1)
crates/biome_service/src/projects.rs (1)

212-222: Nice refactoring to a parameter struct.

The destructuring in the function signature is idiomatic and makes the API more maintainable.

Comment on lines +18 to +26
pub struct GetFileFeaturesParams<'a> {
pub fs: &'a dyn FileSystem,
pub project_key: ProjectKey,
pub path: &'a Utf8Path,
pub features: FeatureName,
pub language: DocumentFileSource,
pub capabilities: &'a Capabilities,
pub skip_ignore_check: bool,
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Add rustdoc documentation for the public struct.

GetFileFeaturesParams is part of the public API and should have documentation explaining its purpose and fields, particularly the new skip_ignore_check flag and when it should be used.

📝 Suggested documentation
+/// Parameters for retrieving file features.
+///
+/// This struct encapsulates all the information needed to determine which
+/// features are supported for a given file path.
+///
+/// # Fields
+///
+/// * `skip_ignore_check` - When `true`, bypasses all ignore checks (VCS, 
+///   `files.includes`, and per-feature ignores). This is used for virtual 
+///   paths provided via `--stdin-file-path` that don't exist on disk.
 pub struct GetFileFeaturesParams<'a> {
     pub fs: &'a dyn FileSystem,
📝 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.

Suggested change
pub struct GetFileFeaturesParams<'a> {
pub fs: &'a dyn FileSystem,
pub project_key: ProjectKey,
pub path: &'a Utf8Path,
pub features: FeatureName,
pub language: DocumentFileSource,
pub capabilities: &'a Capabilities,
pub skip_ignore_check: bool,
}
/// Parameters for retrieving file features.
///
/// This struct encapsulates all the information needed to determine which
/// features are supported for a given file path.
///
/// # Fields
///
/// * `skip_ignore_check` - When `true`, bypasses all ignore checks (VCS,
/// `files.includes`, and per-feature ignores). This is used for virtual
/// paths provided via `--stdin-file-path` that don't exist on disk.
pub struct GetFileFeaturesParams<'a> {
pub fs: &'a dyn FileSystem,
pub project_key: ProjectKey,
pub path: &'a Utf8Path,
pub features: FeatureName,
pub language: DocumentFileSource,
pub capabilities: &'a Capabilities,
pub skip_ignore_check: bool,
}
🤖 Prompt for AI Agents
In crates/biome_service/src/projects.rs around lines 18 to 26, the public struct
GetFileFeaturesParams lacks rustdoc. Add a /// doc comment above the struct
describing its purpose (parameters used to compute features for a single project
file) and add /// comments for each public field explaining what it is and
expected usage; be sure to document the skip_ignore_check boolean (what ignoring
checks it bypasses, typical scenarios to set it true, and any safety or
performance implications), and keep wording concise and consistent with existing
crate docs.

@tt-a1i tt-a1i requested a review from ematipico December 24, 2025 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI A-Formatter Area: formatter A-Linter Area: linter A-LSP Area: language server protocol A-Project Area: project L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: biome format with --stdin-file-path fails if includes is missing the value in --stdin-file-path.

2 participants