-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Quickfix slows down saving files in VSCode #229
Comments
Do you have other extensions that run actions on save ? - If so, could try disabling them and try again to make sure that the Biome extension is the one causing the delay. |
I disabled everything except biome and it was still happening. PS: hmmm.. Interesting, when everything is disabled, it's still happening, sorry! How's that possible? That configuration should be biome specific? |
What I meant is when you save a file, VS Code will run all "on save" actions, and sometimes other extensions register their own actions which can have an impact. I see you mentioned using the insiders version of VS Code. Does that also happen in the stable version ? Also, if you're able to, a link to a reproduction repo would help troubleshooting. |
There appears to be a decent repro in this issue: biomejs/biome#4680 Link: https://github.com/OliverJAsh/biome-vscode-quickfix-import-issue/compare/1.7.3 I've also experienced this in Zod. You can pull down this branch to repro: https://github.com/colinhacks/zod/tree/slow-quickfix
I've introduced a formatting issue at the top of |
@nhedger i am experiencing the same issue in .vue files, quick save is very slow (3 second delay) when i have those settings "editor.codeActionsOnSave": {
"quickfix.biome": "explicit"
}, in extension host output i also see those messages disabling the vue extension or removing those settings makes saving very fast again |
Interesting, I'll definitely have a look, thanks for the details. |
I believe I'm experiencing the same thing. Something feels slow, but I have to mention that biome is very new for me still |
I'm experiencing the same thing in:
I set this setting in my vscode and apparently it works perfect, no lag: "editor.codeActionsOnSave": {
// "quickfix.biome": "explicit",
"source.fixAll.biome": "explicit",
"source.organizeImports.biome": "explicit"
}, Another thing I noticed is that the |
I'm not sure I have understood the difference between these settings, and I can't find clarity in the docs. |
doesn't seem to work (atleast not in vue projects w/vue extension) with same warning in my previous comment |
I wasn't able to reproduce using the previously provided reproductions. For those experiencing the same issue right now, please provide a minimal reproduction that triggers it. |
https://github.com/leotroche/biome-repro-1726568917139
After saving The bug is present regardless of the Important: |
I have investigated this problem. I hope it is useful. reproduction repository: https://github.com/mizdra/quickfix-biome-slow Reproduction Test: Part 1Apparently, the problem reproduces without any 3rd-party extensions. Surprisingly, it reproduces without biome-vscode. The workspace used for reproduction is as follows:
{
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit"
}
}
function fn(){
console.log('hello');
} 2024-09-18.0.10.20.movThis suggests that the problem is caused by something other than the biome-vscode. Reproduction Test: Part 2The problem does not seem to reproduce with The workspace used for reproduction is as follows:
{
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit"
}
}
.foo {
background: black;
} 2024-09-18.0.15.42.movThis suggests that the problem is Reproduction Test: Part 3If you disable VS Code's built-in js/ts extension, the problem does not reproduce. How to disable VS Code's built-in js/ts extension:
2024-09-18.0.22.29.movFrom these tests, I believe the problem is caused by VS Code, VS Code's built-in js/ts extension ( I don't think biome-vscode has anything to do with this problem. |
I confirm the contribution of @mizdra
{
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit"
},
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
} The problem is still present only in |
I have investigated this issue further. It appears to be a compatibility issue between However, I think I need to know about the |
Really appreciate the investigation @mizdra, I'll be following along! |
it's worth noting that this issue also happens not only with Also from my experiments , replacing |
@ragrag You are misunderstanding the problem. This problem is specific to
|
@mizdra what i'm trying to say is that i can confirm that the problem is still reproducible in my case when enabling also disabling |
@ragrag Really? I couldn't reproduce it. 2024-09-22.23.37.24-1.mov2024-09-22.23.37.24-2.movrepo: https://github.com/mizdra/vue-quickfix-biome-test Have you forgotten to restart VS Code? Even if you press the button to disable the extension, the extension will continue to activate until you restart VS Code. To completely disable the extension, you must restart VS Code. |
Yeah i did. I can reproduce this consistently on multiple medium-sized vue apps residing in a medium sized monorepo. I can't seem to reproduce it on fresh vue apps so it's hard for me to isolate it and create a minimal repro but i will try when i have some time later I will atleast try to create a screen capture for demonstration maybe that will help? |
Hmm. That's strange.
Yes, it would be helpful if you could create a reproduction. :) I added my reproduction to #229 (comment). |
I have this same problem with the quickfix. It appears to me that it is waiting for the typescript check to complete before running. The longer the type checking takes the longer the delay appears to be before it saves the file. |
I have the same problem, but it seems that |
I have no problems with Organize imports only sorts and "organizes" the imports, it does not remove unused imports. That is the biggest reason we did want to use the quickfix setting. To remove unused imports. The |
biome 1.9.2 fixed |
Users should start adding the If the client (VSCode, Zed, etc.) sends the correct payload, Biome LSP should apply the changes. |
is there a guide on how to debug this issue or introspect biome trace logs? i can reproduce it in a private monorepo but only when opening the full workspace in vscode, |
I think it's fair to say that this issue is not specific to the biome extension, so I will close it. Feel free to circle back if new information comes to light. |
I take it that the underlying issue is being tracked here: microsoft/vscode#232480 Asking the VSCode team to chime in so we can understand the problem is great, but has the Biome team considered re-implementing the LSP with a different incantation, e.g. This issue is blocking my company from migrating to Biome, which is a bummer because we would otherwise love to use it. |
As you say, I think the problem will be solved if Biome uses Then, We need to guide users to modify {
"editor.codeActionsOnSave": {
- "quickfix.biome": "explicit"
+ "source.fixAll.biome": "explicit"
}
// ...
} Even if typescript-language-features delays |
I get the reluctance to ship a new major version as a maintainer. All I can say as an interested potential user is that I'd love to see this problem get solved sooner. (We have a large Typescript mono-repo that we unsuccessfully tried to migrate to Biome earlier this year, and it was blocked only by the VSCode extension performance, as the CLI itself is very fast.) I did some digging in the docs. The LSP protocol doesn't say anything about the distinction between a quickfix and a fixall, except that they are different code actions. However, the VSCode Typescript docs suggest that "fixall" is the action intended to be used on save because it will compute all the fixes in one round. By contrast, a quickfix is mentioned as an individual suggestion designed to be handled one at a time, and it seems to be listed as an alternative to a "refactor" code action. |
@mizdra would you accept a patch to use |
@JavaScriptBach I am not sure what you mean by "patch." However, you are free to use all the code I used to report this issue and the vscode team. I disclaim their copyright:) |
I just saw there is biomejs/biome#3339. Does this mean that |
|
VS Code version
1.90.0-insiders
Extension version
2.2.3
Biome version
1.7.3
Operating system
Description
When this config is enabled in vscode settings
it slows down saving files in vscode. But not always 😅. When i type something and immediately hit
Cmd + Save
, there's like a second delay before the file is saved.Interestingly enough, if i type something and wait a second and hit save, the file is saved immediately.
Steps to reproduce
"quickfix.biome": "explicit"
,Expected behavior
It should save immediately
Does this issue occur when using the CLI directly?
Not sure / Not applicable
Logs
Logs contain actions that happened when i entered "Enter" and immediately save
The text was updated successfully, but these errors were encountered: