Skip to content

fix(core): document services#8394

Merged
ematipico merged 2 commits intomainfrom
fix/regression-services
Dec 8, 2025
Merged

fix(core): document services#8394
ematipico merged 2 commits intomainfrom
fix/regression-services

Conversation

@ematipico
Copy link
Copy Markdown
Member

Summary

This PR fix a small regression introduced by the recent document services refactor.

This PR updates the services (the CSS semantic model) when the file changes.

Test Plan

N/A

Docs

N/A

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Dec 8, 2025

⚠️ No Changeset found

Latest commit: 51072c3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@github-actions github-actions Bot added the A-Project Area: project label Dec 8, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 8, 2025

Walkthrough

Parsing now returns only the file index and version; document services are computed afterwards. If the document source is CSS-like and either the linter or assist feature is enabled, a CssDocumentServices (with its CSS semantic model) is created and converted to DocumentServices. This conditional service creation occurs post-parse and before embedded-snippet processing.

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the fix: updating document services handling in the core module after a recent refactor.
Description check ✅ Passed The description clearly explains the regression fix and the specific change: updating CSS semantic model services when files change.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/regression-services

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

Copy link
Copy Markdown
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

📜 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 65a0bf4 and 3660b09.

📒 Files selected for processing (1)
  • crates/biome_service/src/workspace/server.rs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
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
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.rs: Use the dbg!() macro for debugging output during testing, and pass the --show-output flag to cargo to view debug output
Use cargo t or cargo test to run tests; for a single test, pass the test name after the test command
Use snapshot testing with the insta crate; run cargo insta accept, cargo insta reject, or cargo insta review to manage snapshot changes
Write doctests as doc comments with code blocks; the code inside code blocks will be run during the testing phase
Use just f (alias for just format) to format Rust and TOML files before committing

Files:

  • crates/biome_service/src/workspace/server.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/workspace/server.rs
🧬 Code graph analysis (1)
crates/biome_service/src/workspace/server.rs (1)
crates/biome_service/src/workspace/document.rs (1)
  • none (278-280)
⏰ 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: Test Node.js API
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: End-to-end tests
  • GitHub Check: autofix
  • GitHub Check: Check Dependencies

Comment thread crates/biome_service/src/workspace/server.rs
Copy link
Copy Markdown
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/workspace/server.rs (1)

1397-1407: CSS services recomputation now matches open_file_internal

Initialising services with DocumentServices::none() and then building CssDocumentServices only when the source is CSS‑like and lint/assist are enabled brings change_file back in line with the open‑path behaviour and should restore the CSS semantic model after edits. If this pattern shows up again, a tiny helper to construct CSS services from a parse + settings could de‑duplicate the logic between open/change, but that’s strictly a nicety.

📜 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 3660b09 and 51072c3.

📒 Files selected for processing (1)
  • crates/biome_service/src/workspace/server.rs (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
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
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.rs: Use the dbg!() macro for debugging output during testing, and pass the --show-output flag to cargo to view debug output
Use cargo t or cargo test to run tests; for a single test, pass the test name after the test command
Use snapshot testing with the insta crate; run cargo insta accept, cargo insta reject, or cargo insta review to manage snapshot changes
Write doctests as doc comments with code blocks; the code inside code blocks will be run during the testing phase
Use just f (alias for just format) to format Rust and TOML files before committing

Files:

  • crates/biome_service/src/workspace/server.rs
🧠 Learnings (4)
📚 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/server.rs
📚 Learning: 2025-11-28T09:08:10.091Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-28T09:08:10.091Z
Learning: Internal crate changes that don't affect user-facing behavior do not require changesets; changesets are only for user-facing changes

Applied to files:

  • crates/biome_service/src/workspace/server.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_service/src/workspace/server.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use language tags in documentation code blocks (js, ts, tsx, json, css) and order properties consistently as: language, then `expect_diagnostic`, then options modifiers, then `ignore`, then `file=path`

Applied to files:

  • crates/biome_service/src/workspace/server.rs
🧬 Code graph analysis (1)
crates/biome_service/src/workspace/server.rs (1)
crates/biome_service/src/workspace/document.rs (1)
  • none (278-280)
⏰ 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). (9)
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: End-to-end tests
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Check Dependencies
  • GitHub Check: Test Node.js API
  • GitHub Check: autofix
🔇 Additional comments (1)
crates/biome_service/src/workspace/server.rs (1)

1365-1369: Reusing file_source_index on reparse looks sound

Pulling both file_source_index and version from the existing Document keeps the language/source stable across change_file calls, while preserving the existing version guards. Behaviour for missing documents and stale versions is unchanged and correct.

@ematipico ematipico merged commit c98e707 into main Dec 8, 2025
12 checks passed
@ematipico ematipico deleted the fix/regression-services branch December 8, 2025 12:22
l0ngvh pushed a commit to l0ngvh/biome that referenced this pull request Dec 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Project Area: project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant