Skip to content

feat(biome_service): include file path in NotFound diagnostic#9364

Merged
ematipico merged 5 commits intobiomejs:mainfrom
xvchris:fix/9357-not-found-file-path
Mar 8, 2026
Merged

feat(biome_service): include file path in NotFound diagnostic#9364
ematipico merged 5 commits intobiomejs:mainfrom
xvchris:fix/9357-not-found-file-path

Conversation

@xvchris
Copy link
Copy Markdown

@xvchris xvchris commented Mar 6, 2026

Summary

Closes #9357

The NotFound diagnostic previously showed a generic message:

The file does not exist in the workspace.

without indicating which file was missing, making it impossible to debug in large projects.

This PR adds the file path to the diagnostic message:

The file not_found.js does not exist in the workspace.

AI Assistance Notice

This PR was written primarily with AI assistance (Claude). The implementation, tests, and changeset were all generated with AI help.

Changes

  • Changed NotFound from a unit struct to a struct with a path: String field annotated with #[location(resource)]
  • Updated WorkspaceError::not_found() to accept a path parameter
  • Updated all call sites in workspace/server.rs to pass the file path
  • Added a changeset for the patch release

Test Plan

cargo test -p biome_service -- diagnostics::test::not_found
# 1 passed; 0 failed

Docs

No documentation changes needed — this is an internal diagnostic improvement.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 6, 2026

🦋 Changeset detected

Latest commit: 99f1027

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-Project Area: project label Mar 6, 2026
Copy link
Copy Markdown
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.

Looks good, three things need addressing:

  • a comment of mine
  • missing changeset
  • AI disclosure (it's clearly AI stuff) by following our guidelines
  • restore our PR template

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 6, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The NotFound diagnostic was changed from a unit variant to a struct containing path: String (annotated as a resource location). WorkspaceError::not_found now requires a path and constructs NotFound { path }. Diagnostic messages and descriptions now reference {self.path}. Server call sites and tests were updated to pass the file path when producing not-found errors. A patch-level changelog entry was added under .changeset documenting the change.

Suggested labels

A-Core

Suggested reviewers

  • arendjr
  • dyc3
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding file path inclusion to the NotFound diagnostic.
Description check ✅ Passed The description is well-structured, clearly explaining the problem, the solution, and providing test evidence. It directly relates to the changeset.
Linked Issues check ✅ Passed The PR fully addresses issue #9357 by replacing the generic 'file does not exist' message with a path-specific message via the NotFound struct changes.
Out of Scope Changes check ✅ Passed All changes are scoped to the NotFound diagnostic enhancement. No unrelated modifications detected across the three modified files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 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
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.

🧹 Nitpick comments (1)
.changeset/include-file-path-not-found.md (1)

5-5: Consider starting with issue link format.

As per coding guidelines, bug fix changesets should start with Fixed [#9357](https://github.com/biomejs/biome/issues/9357): ... format to link the resolved issue.

Suggested format
-Include the file path in the `NotFound` diagnostic message so users can identify which file is missing from the workspace.
+Fixed [`#9357`](https://github.com/biomejs/biome/issues/9357): Include the file path in the `NotFound` diagnostic message so users can identify which file is missing from the workspace.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.changeset/include-file-path-not-found.md at line 5, Update the changeset
header to follow the bug-fix format "Fixed
[`#9357`](https://github.com/biomejs/biome/issues/9357): ..." and modify the
NotFound diagnostic message to include the missing file path so users know which
file is absent; locate the diagnostic creation/use site (the code that
constructs the NotFound diagnostic object or calls a function named
NotFound/diagnostic/emitNotFound) and interpolate the file path variable into
the message (e.g., "File not found: <path>") before emitting or returning the
diagnostic.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.changeset/include-file-path-not-found.md:
- Line 5: Update the changeset header to follow the bug-fix format "Fixed
[`#9357`](https://github.com/biomejs/biome/issues/9357): ..." and modify the
NotFound diagnostic message to include the missing file path so users know which
file is absent; locate the diagnostic creation/use site (the code that
constructs the NotFound diagnostic object or calls a function named
NotFound/diagnostic/emitNotFound) and interpolate the file path variable into
the message (e.g., "File not found: <path>") before emitting or returning the
diagnostic.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b2c16a23-79a0-449f-950e-5dcb1de99419

📥 Commits

Reviewing files that changed from the base of the PR and between fc9ca4c and 02720a8.

⛔ Files ignored due to path filters (1)
  • crates/biome_service/src/snapshots/not_found.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (3)
  • .changeset/include-file-path-not-found.md
  • crates/biome_service/src/diagnostics.rs
  • crates/biome_service/src/workspace/server.rs

xvchris added 2 commits March 6, 2026 19:05
The #[location(resource)] attribute on the path field already sets
the file path in the diagnostic, making with_file_path unnecessary.
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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.changeset/include-file-path-not-found.md:
- Line 5: Remove the trailing space at the end of the sentence "Fixed
[`#9357`](https://github.com/biomejs/biome/issues/9357). Improved the information
emitted by some diagnostics." so the line ends immediately after the final
period; simply delete the extra whitespace character causing the pipeline
failure.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 45f4b569-2326-406c-8f93-6a78b24bc974

📥 Commits

Reviewing files that changed from the base of the PR and between a1d2a88 and 7661ae4.

📒 Files selected for processing (1)
  • .changeset/include-file-path-not-found.md

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.

🧹 Nitpick comments (1)
.changeset/include-file-path-not-found.md (1)

5-5: Consider a more specific description.

Whilst "some diagnostics" is technically accurate, the description could be more specific to help users understand the impact. Something like "File not found errors now include the missing file path to aid debugging" would immediately convey what changed and why it matters.

As per coding guidelines: Changeset descriptions should explain the impact and what changed for end users in 1-3 sentences.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.changeset/include-file-path-not-found.md at line 5, Update the changeset
summary in .changeset/include-file-path-not-found.md to be specific and 1–3
sentences long: replace the vague "Improved the information emitted by some
diagnostics" with a concise description of the user-visible change (e.g., "File
not found errors now include the missing file path to aid debugging") and ensure
the entry references the issue number (Fixed `#9357`) and clearly states the
impact for end users.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.changeset/include-file-path-not-found.md:
- Line 5: Update the changeset summary in
.changeset/include-file-path-not-found.md to be specific and 1–3 sentences long:
replace the vague "Improved the information emitted by some diagnostics" with a
concise description of the user-visible change (e.g., "File not found errors now
include the missing file path to aid debugging") and ensure the entry references
the issue number (Fixed `#9357`) and clearly states the impact for end users.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 04f6a152-9046-4c6f-8e94-907aea885e38

📥 Commits

Reviewing files that changed from the base of the PR and between 7661ae4 and 99f1027.

📒 Files selected for processing (1)
  • .changeset/include-file-path-not-found.md

@ematipico ematipico merged commit 1bb9edc into biomejs:main Mar 8, 2026
13 checks passed
@github-actions github-actions bot mentioned this pull request Mar 8, 2026
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.

🐛 "The file does not exist in the workspace." What file?

2 participants