fix(lsp): handle wrapped settings in didChangeConfiguration#9611
fix(lsp): handle wrapped settings in didChangeConfiguration#9611ematipico merged 3 commits intobiomejs:mainfrom
Conversation
🦋 Changeset detectedLatest commit: abff7a3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
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 |
f8deb9c to
85e8891
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
WalkthroughThis pull request fixes an LSP regression where workspace configuration updates sent via Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
.changeset/fix-wrapped-did-change-configuration.mdcrates/biome_lsp/src/server.tests.rscrates/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 |
There was a problem hiding this comment.
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.
| 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.
This fixes a regression in the Biome LSP configuration update path.
When handling
workspace/didChangeConfiguration, the server assumed thatparams.settingsalways contained the inner Biome settings object. However, some clients send a wrapped payload such as{"biome": {...}}. After#9323, this became user-visible becausedidChangeConfigurationstarted 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:biomekeyIt also adds a regression test covering wrapped Biome settings sent through
didChangeConfiguration.Related issue
Fixed biome-zed#59:
require_config_filecould be ignored in Zed when the client sent wrapped Biome settings throughworkspace/didChangeConfiguration.Validation
require_config_file.d5ee4690bb(#9323).should_apply_wrapped_biome_settings_from_did_change_configurationAI disclosure
I used AI assistance to help investigate the regression, narrow down the introducing commit, and draft the fix/test.