feat: resolve variables in custom path settings#1014
Open
silverstein wants to merge 3 commits intobiomejs:mainfrom
Open
feat: resolve variables in custom path settings#1014silverstein wants to merge 3 commits intobiomejs:mainfrom
silverstein wants to merge 3 commits intobiomejs:mainfrom
Conversation
🦋 Changeset detectedLatest commit: fabfc86 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
nhedger
reviewed
Apr 7, 2026
.changeset/five-apricots-resolve.md
Outdated
| @@ -0,0 +1,6 @@ | |||
| --- | |||
| "biome": patch | |||
Member
There was a problem hiding this comment.
Suggested change
| "biome": patch | |
| "biome": minor |
Author
|
Makes sense to me. I was thinking of it as a bug fix for existing settings, but I’m happy to treat the user-visible behavior change as |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #721.
This updates the extension to resolve common VS Code variables in path-like Biome settings before they are used locally or returned to the language server.
What changed
biome.lsp.binand deprecatedbiome.lspBinnow expand variables such as${workspaceFolder},${workspaceFolder:name},${userHome},${cwd}, and${env:NAME}before path resolution.biome.configurationPathnow goes through the same expansion when the language server requestsbiomesettings viaworkspace/configuration.workspace/configurationrequests forbiome.configurationPath,biome.lsp.bin, andbiome.lspBin, so local path resolution and server-side settings stay aligned.Why this fixes the issue
Before this change, the extension treated configured paths as literal strings. That meant settings like:
"biome.lsp.bin": "${userHome}/.../biome""biome.configurationPath": "${workspaceFolder}/biome.json"were passed through without interpolation, so the binary lookup and config lookup failed even though the expanded paths were valid.
Verification
Repo checks
pnpm exec biome check src/session.ts src/utils.ts .changeset/five-apricots-resolve.mdpnpm run typecheckpnpm run buildnpx -y node@24.14.1 ./node_modules/@vscode/vsce/vsce package --out biome.vsixNote:
pnpm run packagefailed under local Node 25 because of avscedependency/runtime mismatch, but packaging succeeded under the repo's pinned Node24.14.1from.node-version.Manual extension-host validation
Launched a clean VS Code extension-development window with isolated
--user-data-dirand a throwaway workspace configured with:"biome.lsp.bin": "${workspaceFolder}/node_modules/.bin/biome""biome.configurationPath": "${workspaceFolder}/biome.json"Observed in the extension logs that:
biome.lsp.binwas expanded and successfully unshimmed from the workspace-relative path to the real bundled Biome binary.workspace/configurationresponse contained"configurationPath": "/tmp/biome-vscode-test-ws/biome.json"as an absolute path, not the raw${workspaceFolder}string.AI assistance
I used Codex (GPT-5.4, high reasoning) to help with implementation and drafting, then reviewed the code, fixed issues found during an adversarial follow-up review, and ran the verification above.