biome-vscode: 🐛 biome.json looks to be ignored periodically
VS Code version
1.92.1
Extension version
2.3.0
Biome version
1.8.3
Operating system
- Windows
- macOS
- Linux
Description
I set biome.json and settings.json as follows.
biome.json
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"formatter": {
"indentStyle": "space",
"indentWidth": 4,
"lineWidth": 120
},
"javascript": {
"formatter": {
"semicolons": "asNeeded"
}
}
}
settiings.json
{
"[typescript]": {
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit",
"source.organizeImports.biome": "explicit"
},
"editor.defaultFormatter": "biomejs.biome"
},
}
It works well for typescript at first, but after a while (30 minutes or 1 hour?), code formatting on save breaks, which means it looks VSCode ignores biome.json and apply default format style. This will be fixed if I restart VSCode, but after a while, the same phenomenon happens. I also found it will be fixed if I do not restart VSCode and keep using VSCode for a while. I totally don’t have any idea of this cyclic bug. Any ideas?
Steps to reproduce
- Keep using VSCode for a while
- biome.json looks to be ignored
- Keep using VSCode for awhile
- biome.json looks to be applied
- …
Expected behavior
Consistent formatting is expected with biome.json.
Does this issue occur when using the CLI directly?
Not sure / Not applicable
Logs
Biome binary found at /Users/hoge/Projects/REPO/node_modules/@biomejs/cli-darwin-arm64/biome
Copying binary to temporary folder: file:///Users/hoge/Library/Application%20Support/Code/User/workspaceStorage/2e44b1a2da91f731d8a531fabbc226e4/biomejs.biome/biome
Executing Biome from: /Users/hoge/Library/Application Support/Code/User/workspaceStorage/2e44b1a2da91f731d8a531fabbc226e4/biomejs.biome/biome
[cli-stdout] data 66
[cli] exit 0
Connecting to "/Users/hoge/Library/Caches/dev.biomejs.biome/biome-socket-1.8.3" ...
[Info - 2:53:32] Server initialized with PID: 58092
[Warn - 3:25:19] Code formatting aborted due to parsing errors. To format code with errors, enable the 'formatter.formatWithErrors' option.
[Warn - 3:25:27] Code formatting aborted due to parsing errors. To format code with errors, enable the 'formatter.formatWithErrors' option.
Reloading biome executable.
Biome binary found at /Users/hoge/Projects/REPO/node_modules/@biomejs/cli-darwin-arm64/biome
Copying binary to temporary folder: file:///Users/hoge/Library/Application%20Support/Code/User/workspaceStorage/2e44b1a2da91f731d8a531fabbc226e4/biomejs.biome/biome
[cli-stderr] end
[cli-stdout] end
[cli-stderr] finish
[cli-stdout] finish
[cli-stdout] close
[cli] close 0
[cli-stderr] close
Executing Biome from: /Users/hoge/Library/Application Support/Code/User/workspaceStorage/2e44b1a2da91f731d8a531fabbc226e4/biomejs.biome/biome
[cli-stdout] data 66
[cli] exit 0
Connecting to "/Users/hoge/Library/Caches/dev.biomejs.biome/biome-socket-1.8.3" ...
[Info - 3:49:15] Server initialized with PID: 16400
[Warn - 3:56:19] Code formatting aborted due to parsing errors. To format code with errors, enable the 'formatter.formatWithErrors' option.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 5
- Comments: 37 (15 by maintainers)
Only in vscode
I was able to reproduce the issue on a mac
perms on that file are -rw-r–r–
I was able to fix the issue by forcibly giving full disk access to the binary file in mac os settings /Users/irdkwmnsb-mac/Library/Application Support/Code/User/workspaceStorage/0ade50184995cbb61ae311ac477de5d5/biomejs.biome/biome
After LSP server restart biome is able to read the settings, but only for a short moment.
But killing the process means it’s path will change under the “workspaceStorage” and you would have to again give full disk access.
Facing the same issue. For what it’s worth, the issues only seem to happen when using multi-root workspaces.
The experience is wonky enough that the extension is useless with multi-root workspaces and non-default config 😕
I opened the workspace by clicking the green button.
Thanks, will look into it !
@nhedger I’ve created minimal reproduction. https://github.com/Hoshock/Biome-Issue304-Reproduction