Skip to content

fix(lsp): handle wrapped settings in didChangeConfiguration#9611

Merged
ematipico merged 3 commits intobiomejs:mainfrom
gaauwe:fix/zed-did-change-configuration-settings
Mar 24, 2026
Merged

fix(lsp): handle wrapped settings in didChangeConfiguration#9611
ematipico merged 3 commits intobiomejs:mainfrom
gaauwe:fix/zed-did-change-configuration-settings

Conversation

@gaauwe
Copy link
Copy Markdown
Contributor

@gaauwe gaauwe commented Mar 23, 2026

This fixes a regression in the Biome LSP configuration update path.

When handling workspace/didChangeConfiguration, the server assumed that params.settings always contained the inner Biome settings object. However, some clients send a wrapped payload such as {"biome": {...}}. After #9323, this became user-visible because didChangeConfiguration started reloading workspace settings immediately, causing the misread settings to re-enable capabilities/diagnostics unexpectedly.

This change makes load_extension_settings(Some(settings)) accept both shapes:

  • the inner settings object directly
  • a wrapped object containing a top-level biome key

It also adds a regression test covering wrapped Biome settings sent through didChangeConfiguration.

Related issue

Fixed biome-zed#59: require_config_file could be ignored in Zed when the client sent wrapped Biome settings through workspace/didChangeConfiguration.

Validation

  • Reproduced the issue in Zed with require_config_file.
  • Verified that the regression becomes observable at d5ee4690bb (#9323).
  • Added and ran the regression test:
    • should_apply_wrapped_biome_settings_from_did_change_configuration

AI disclosure

I used AI assistance to help investigate the regression, narrow down the introducing commit, and draft the fix/test.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 23, 2026

🦋 Changeset detected

Latest commit: abff7a3

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 Mar 23, 2026
@gaauwe gaauwe force-pushed the fix/zed-did-change-configuration-settings branch from f8deb9c to 85e8891 Compare March 23, 2026 20:28
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 23, 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: 162a14d8-2a5d-4765-b08a-ab48d4ee87b0

📥 Commits

Reviewing files that changed from the base of the PR and between f8deb9c and 85e8891.

📒 Files selected for processing (1)
  • .changeset/three-candles-tan.md
✅ Files skipped from review due to trivial changes (1)
  • .changeset/three-candles-tan.md

Walkthrough

This pull request fixes an LSP regression where workspace configuration updates sent via workspace/didChangeConfiguration were incorrectly parsed when the payload was wrapped in a top-level biome key. The fix modifies the settings extraction logic to unwrap the configuration sub-value when present, falling back to the original settings if absent. A new test verifies the corrected behaviour.

Possibly related PRs

Suggested reviewers

  • ematipico
  • dyc3
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: fixing LSP handling of wrapped settings in didChangeConfiguration.
Description check ✅ Passed The description comprehensively explains the regression, the fix, related issues, validation steps, and AI disclosure—all directly relevant to the changeset.

✏️ 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.

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/fix-wrapped-did-change-configuration.md:
- Line 5: Replace the current changeset sentence "Fixed a regression where Biome
LSP could misread editor settings..." so it follows the issue-linked bug-fix
style: begin with "Fixed [`#NUMBER`](issue link): " followed by the user-facing
description (e.g. "Fixed [`#1234`](https://github.com/.../issues/1234): Biome LSP
misread editor settings sent via workspace/didChangeConfiguration when payloads
were wrapped in a top-level `biome` key, causing `requireConfiguration` and
related settings to be ignored."). Also ensure the file ends with a single
trailing newline character.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e187b2e1-3cb5-4a55-b242-337572b80f56

📥 Commits

Reviewing files that changed from the base of the PR and between db67d22 and f8deb9c.

📒 Files selected for processing (3)
  • .changeset/fix-wrapped-did-change-configuration.md
  • crates/biome_lsp/src/server.tests.rs
  • crates/biome_lsp/src/session.rs

"@biomejs/biome": patch
---

Fixed a regression where Biome LSP could misread editor settings sent through `workspace/didChangeConfiguration` when the payload was wrapped in a top-level `biome` key. This caused `requireConfiguration` and related settings to be ignored in some editors. No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Please use the issue-linked bug-fix format and add the final newline.

Line 5 is currently failing markdownlint (MD047), and the sentence should follow the issue-linked changeset style for bug fixes.

✍️ Proposed edit
-Fixed a regression where Biome LSP could misread editor settings sent through `workspace/didChangeConfiguration` when the payload was wrapped in a top-level `biome` key. This caused `requireConfiguration` and related settings to be ignored in some editors.
+Fixed [`#59`](https://github.com/biomejs/biome-zed/issues/59): Biome LSP could misread editor settings sent through `workspace/didChangeConfiguration` when the payload was wrapped in a top-level `biome` key, causing `requireConfiguration` and related settings to be ignored in some editors.
+

As per coding guidelines "Write changeset descriptions for end users, not developers. For bug fixes, start with 'Fixed [#NUMBER](issue link): ...'."
Based on learnings "For BiomeJS changeset markdown entries, use the formatted prefix Fixed [#NUMBER](issue link): ... only when there is a corresponding GitHub issue for the bug."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Fixed a regression where Biome LSP could misread editor settings sent through `workspace/didChangeConfiguration` when the payload was wrapped in a top-level `biome` key. This caused `requireConfiguration` and related settings to be ignored in some editors.
Fixed [`#59`](https://github.com/biomejs/biome-zed/issues/59): Biome LSP could misread editor settings sent through `workspace/didChangeConfiguration` when the payload was wrapped in a top-level `biome` key, causing `requireConfiguration` and related settings to be ignored in some editors.
🧰 Tools
🪛 GitHub Actions: Pull request Markdown

[error] 5-5: markdownlint-cli2 (markdownlint MD047): Files should end with a single newline character.

🪛 GitHub Check: lint

[failure] 5-5: Files should end with a single newline character
.changeset/fix-wrapped-did-change-configuration.md:5:256 MD047/single-trailing-newline Files should end with a single newline character https://github.com/DavidAnson/markdownlint/blob/v0.40.0/doc/md047.md

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

In @.changeset/fix-wrapped-did-change-configuration.md at line 5, Replace the
current changeset sentence "Fixed a regression where Biome LSP could misread
editor settings..." so it follows the issue-linked bug-fix style: begin with
"Fixed [`#NUMBER`](issue link): " followed by the user-facing description (e.g.
"Fixed [`#1234`](https://github.com/.../issues/1234): Biome LSP misread editor
settings sent via workspace/didChangeConfiguration when payloads were wrapped in
a top-level `biome` key, causing `requireConfiguration` and related settings to
be ignored."). Also ensure the file ends with a single trailing newline
character.

@github-actions github-actions Bot added the A-Project Area: project label Mar 23, 2026
@ematipico ematipico merged commit cddaa44 into biomejs:main Mar 24, 2026
13 of 14 checks passed
This was referenced Mar 23, 2026
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.

Enable biome only when biome.json is present gives error

2 participants