Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ematipico
Copy link
Member

Summary

The Biome language server already uses the LSP to monitor nested configuration files.

This PR adds ignore files too, and in turn enables the Biome project watcher only if ScanKind is ::Project.

Test Plan

Unfortunately, I couldn't create a test because we can't simulate file system changes after we created the server. However I did manual testing and I could see the diagnostics correctly updated when:

  • I updated the configuration file
  • I updated the ignore file

Docs

@changeset-bot
Copy link

changeset-bot bot commented Nov 10, 2025

🦋 Changeset detected

Latest commit: 53f5714

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

@github-actions github-actions bot added the A-LSP Area: language server protocol label Nov 10, 2025
@ematipico ematipico changed the title fix(lsp): Biome project watcher fix(lsp): biome project watcher Nov 10, 2025
@ematipico ematipico requested review from a team November 10, 2025 10:35
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 10, 2025

Walkthrough

This PR introduces a changeset documenting two LSP improvements. It fixes an issue where the Biome Language Server would enable its project file watcher regardless of whether project rules were configured. The changes add file system watchers for nested .gitignore and .ignore files, treating them as configuration changes alongside .editorconfig. Additionally, the session's project scanning now conditionally enables watching based on scan type rather than unconditionally.

Possibly related PRs

Suggested labels

A-Project

Suggested reviewers

  • siketyan
  • dyc3

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly relates to the changeset, explaining the motivation (adding ignore file monitoring and conditional project watcher) and including manual testing results.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title directly summarises the main change: fixing the Biome project watcher behaviour in the LSP to only enable watching when project rules are active.
✨ 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/watcher-in-lsp

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

🧹 Nitpick comments (1)
.changeset/brave-tires-tap.md (1)

7-7: Drop the extra comma

Reads more smoothly without the comma before “if”.

-Now the watching of nested configuration files and nested ignore files is delegated to the editor, if their LSP spec supports it.
+Now the watching of nested configuration files and nested ignore files is delegated to the editor if their LSP spec supports it.
📜 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 be15544 and 53f5714.

📒 Files selected for processing (3)
  • .changeset/brave-tires-tap.md (1 hunks)
  • crates/biome_lsp/src/server.rs (3 hunks)
  • crates/biome_lsp/src/session.rs (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/../biome_lsp/src/server.tests.rs : Keep end-to-end LSP tests in ../biome_lsp/src/server.tests.rs
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Place watcher tests related to workspace methods in src/workspace/watcher.tests.rs
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Place watcher tests related to workspace methods in src/workspace/watcher.tests.rs

Applied to files:

  • crates/biome_lsp/src/session.rs
  • crates/biome_lsp/src/server.rs
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/src/workspace_watcher.rs : WorkspaceWatcher should synchronize workspace state with the filesystem and be active only in daemon mode (not used by the CLI)

Applied to files:

  • crates/biome_lsp/src/session.rs
  • crates/biome_lsp/src/server.rs
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/../biome_lsp/src/server.tests.rs : Keep end-to-end LSP tests in ../biome_lsp/src/server.tests.rs

Applied to files:

  • crates/biome_lsp/src/server.rs
🪛 LanguageTool
.changeset/brave-tires-tap.md

[typographical] ~7-~7: Usually, there’s no comma before “if”.
Context: ... ignore files is delegated to the editor, if their LSP spec supports it.

(IF_NO_COMMA)

⏰ 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). (3)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Test Node.js API
  • GitHub Check: Lint project (depot-windows-2022)
🔇 Additional comments (1)
crates/biome_lsp/src/session.rs (1)

708-712: Watcher flag matches the scan kind

Thanks for only flipping the watcher on when we truly have a project scan; my laptop fans and I approve.

@ematipico ematipico merged commit 5f68bcc into main Nov 10, 2025
14 of 15 checks passed
@ematipico ematipico deleted the fix/watcher-in-lsp branch November 10, 2025 17:55
@github-actions github-actions bot mentioned this pull request Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LSP Area: language server protocol

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants