Skip to content

fix(cli): fix codeAction/resolve not considering assist actions#9812

Merged
ematipico merged 5 commits intobiomejs:mainfrom
elliotcourant:fix/organize-imports
Apr 6, 2026
Merged

fix(cli): fix codeAction/resolve not considering assist actions#9812
ematipico merged 5 commits intobiomejs:mainfrom
elliotcourant:fix/organize-imports

Conversation

@elliotcourant
Copy link
Copy Markdown
Contributor

This PR was made using the guidance of AI to help understand the code and recent changes made to the code that introduced the bug.

Summary

The change made in #9627 improved how code actions were handled, but omitted handling of code actions for assit rule groups and was only handling the code actions for the linter rule group. This just adds the assist rule group back in.

#9741 I believe this will resolve part of this issue, but the other part of this issue was already resolved in #9745

Test Plan

I've added tests here to make sure that the specific code action that was misbehaving (manifesting as an -32603: The rule doesn't exist error in my editor) is now present as a rule for the code action to resolve.

If there is more I can do here please let me know.

Docs

N/A

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 5, 2026

⚠️ No Changeset found

Latest commit: 7e38f5f

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 Apr 5, 2026
The change made in biomejs#9627 improved how code actions were handled, but
omitted handling of code actions for assit rule groups and was only
handling the code actions for the linter rule group. This just adds the
assist rule group back in.
@elliotcourant elliotcourant force-pushed the fix/organize-imports branch from d09b5fa to b576f08 Compare April 5, 2026 17:34
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: acace598-2bea-4d44-9d56-f57c078db38a

📥 Commits

Reviewing files that changed from the base of the PR and between 094afda and 7e38f5f.

📒 Files selected for processing (1)
  • crates/biome_lsp/src/server.tests.rs
✅ Files skipped from review due to trivial changes (1)
  • crates/biome_lsp/src/server.tests.rs

Walkthrough

The pull request updates RuleSelector::from_group_and_rule to also resolve assist rules via assist::RuleGroup and Actions::has_rule in addition to the existing linter resolution path, and adds unit tests verifying assist rules in the source group map to RuleSelector::Rule(...) while invalid assist names return None. It also adds a Tokio LSP integration test that checks codeAction/resolve returns a WorkspaceEdit with TextEdits for a source.organizeImports.biome code action.

Suggested labels

A-Linter

Suggested reviewers

  • dyc3
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main fix: restoring codeAction/resolve handling for assist actions that was inadvertently omitted.
Description check ✅ Passed The description clearly explains the bug (assist rule group handling was omitted in #9627), the fix (restoring assist rule group handling), links to related issues, and describes the test additions.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@elliotcourant elliotcourant changed the title fix(cli): Fix codeAction/resolve not considering assist actions fix(cli): fix codeAction/resolve not considering assist actions Apr 5, 2026
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/short-rings-help.md:
- Around line 2-5: The changeset uses "minor" and a plain description; change
the release type to "patch" and rewrite the description to the bug-fix issue
format (start with "Fixed [`#ISSUE_NUMBER`](issue link): ...") so the entry in
.changeset/short-rings-help.md follows the project's guidance for bug fixes on
main; update the first line token from "@biomejs/biome: minor" to
"@biomejs/biome: patch" and replace "Fix codeAction/resolve not considering
assist actions" with a description prefixed by "Fixed [`#NUMBER`](URL):"
referencing the appropriate issue.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8265ee4e-2d19-4324-85bc-79f09c43d71e

📥 Commits

Reviewing files that changed from the base of the PR and between 1d09f0f and e7129dc.

📒 Files selected for processing (2)
  • .changeset/short-rings-help.md
  • crates/biome_configuration/src/analyzer/mod.rs

Comment thread .changeset/short-rings-help.md Outdated
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 5, 2026

Merging this PR will not alter performance

✅ 1 untouched benchmark
⏩ 255 skipped benchmarks1


Comparing elliotcourant:fix/organize-imports (7e38f5f) with main (1d09f0f)

Open in CodSpeed

Footnotes

  1. 255 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@dyc3
Copy link
Copy Markdown
Contributor

dyc3 commented Apr 5, 2026

Are you saying that the bug wasn't completely fixed in #9745?

@elliotcourant
Copy link
Copy Markdown
Contributor Author

elliotcourant commented Apr 5, 2026

Are you saying that the bug wasn't completely fixed in #9745?

@dyc3 I believe so yes but I might be misunderstanding the code here.

Basically my understanding is that the from_lsp_filter gives back the full list of rules, but from_group_and_rules only including linting ones will cause ones like the organize imports to return None instead. But with the way its doing it it would still serialize none and then when the rule is resolved here:

let rule_selector =
AnalyzerSelector::Rule(resolve_data.rule.context("The rule doesn't exist")?);
it produces the error that I'm seeing in my editor

Hopefully this makes sense and I'm not chasing nothing

@ematipico
Copy link
Copy Markdown
Member

@elliotcourant it would beneficial to also provide a LSP test, so that we can prove the fix. The tests in the current pr aren't enough

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.

The fix makes sense to me, but I would add an integration test too (one inside the LSP crate)

Comment thread .changeset/short-rings-help.md Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The original issue is already closed. Since you're fixing code that hasn't been shipped yet, I believe the changeset isn't needed

@elliotcourant
Copy link
Copy Markdown
Contributor Author

I'll work on those tests, thank you!

This test is just based on the one that came before it for biomejs#9741
@github-actions github-actions Bot added the A-LSP Area: language server protocol label Apr 6, 2026
@elliotcourant
Copy link
Copy Markdown
Contributor Author

Added a test based on the other related tests, and removed the change set. Thank you!

@ematipico ematipico merged commit 878c476 into biomejs:main Apr 6, 2026
14 checks passed
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 A-Project Area: project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants