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: 0d56a71

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

"@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.

@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

This PR fixes stdin formatting when using --stdin-file-path with a path that doesn't exist on disk or isn't covered by files.includes rules. It introduces an ignore_includes boolean flag to the file features query system, allowing virtual paths (stdin) to bypass include/exclude filtering. Changes span the CLI command documentation, execution paths for stdin handling, the LSP handlers, and the core service layer that computes file feature support. A test validates the new behaviour.

Possibly related PRs

Suggested labels

A-Core

Suggested reviewers

  • ematipico
  • dyc3
  • siketyan

Pre-merge checks and finishing touches

✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarises the main change: allowing --stdin-file-path to work outside files.includes when the path is virtual.
Description check ✅ Passed The description clearly explains the fix: stdin formatting no longer blocked by files.includes for virtual paths, whilst preserving behaviour for real files.
Linked Issues check ✅ Passed The PR successfully addresses issue #6783 by allowing virtual paths via --stdin-file-path to bypass files.includes filtering whilst preserving filtering for real files and VCS ignores.
Out of Scope Changes check ✅ Passed All changes directly support the core fix: parameter additions to enable ignore_includes flag, CLI help updates, test additions, and refactoring to address clippy lints are all within scope.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

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-LSP Area: language server protocol A-Project Area: project

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