vetur
vetur copied to clipboard
Getting code actions from ''Vetur', 'Eslint'' takes too long!
Info
- Platform: macOS
- Vetur version:0.26.1
- VS Code version: 1.47.3
Problem
Since I upgraded Vetur from 0.25.0 to 0.26.1, after I edit and save .vue files, vscode get stuck with this promote:
even though the change is very mirror. I have to downgrade to 0.25.0 to avoid this !
local eslint version is [email protected] here is my vsocde setting:
{
"vetur.format.defaultFormatterOptions": {
"prettier": {
"semi": false,
"singleQuote": true,
"tabWidth": 4
}
},
"vetur.validation.template": true,
"vetur.format.options.tabSize": 4,
"vetur.format.defaultFormatter.js": "prettier-eslint",
"[vue]": {
"editor.defaultFormatter": "octref.vetur"
},
"vetur.format.defaultFormatter.html": "prettier",
"eslint.alwaysShowStatus": true,
"eslint.validate": [
"javascript",
"javascriptreact",
"vue",
"typescript",
"typescriptreact"
],
"eslint.options": {
"extensions": [
".html",
".js",
".vue",
".jsx"
]
}
}
Reproducible Case
I meet the same issue on Win as well. Downgrading to 0.25.0 temporarily solve problem
I have the same problem, too
Not sure if this is not another extension I have but just throwing it out there - does anybody's code sometimes get mangled (eg. one line gets duplicated) after Vetur + Eslint code actions finish after a long time?
eg.
before code actions start to run: props: ['foo']
after code action finish: props:['foo']ops['foo']
@3nuc This happens for me sometimes, when I cancel the long running action. Maybe eslint/prettier related?
I'm having the same issue, any solutions/workarounds? :)
Edit: The only thing that works is exiting VSCode and reopen the project. How to provide debug info?
Edit 2: This is on Linux using the latest VSCode.
- Does this reproduce when you only have Vetur extension enabled? (Especailly with ESLint disabled)
- Does setting
"eslint.codeActionsOnSave.mode": "problems"
help?
@octref
Does this reproduce when you only have Vetur extension enabled? (Especailly with ESLint disabled)
For me, yes. When I have both vetur and eslint enabled I am getting the same message as @daolanfler
Saving 'Test.vue': Getting code actions from ''Vetur', 'ESLint'' (configure)
and it hangs for 5 to 7 seconds. Disabling eslint doesn't fix it, Also, one important thing I have to add here is that the mentioned message is shown only once when I try to save .vue file with lint problems. After the message disappears, saving the same file or any other .vue file with lint problems is immediate.
Does setting "eslint.codeActionsOnSave.mode": "problems" help?
Nope.
I've had this issue for quite a long time. I'm using TS in a Quasar project and after a fresh open of VS Code and starting the dev server it works fine for a while. After about a half hour of use, it starts taking a very long time to finish linting lines before save. When saving, if the before-save linting didn't quite finish, I get the code actions pop up for up to half a minute. On a pretty powerful computer, so that shouldn't be the issue
I'm not sure, but it seems to be related to this issue https://github.com/microsoft/vscode/issues/101555. My hunch is that incomplete save participants are hanging around in a process which ends up slowing everything down. I don't have any way to prove or reproduce, but they both seem to happen around the same time.
@octref Just to confirm here the setting doesn't fix the 'Getting code actions from..' hang.
Another observation I found that the issue occurs if try to format or save in a specific workspace. The extensions works perfect if I change the project workspace.
Temporary fix I use: > Developer: Restart extension host
. After that linting/saving is fast but it slows down again over time. Must be something is causing the work for the linting process to pile up every time it runs? Based on how the highlighted errors change throughout the process, it's as if it's trying to lint every previously linted version of the file. Issue also seems way more pronounced on my linux laptop than on my powerful windows desktop. I hope this gets fixed soon, it's been bugging me for too long.
Temporary fix I use:
> Developer: Restart extension host
. After that linting/saving is fast but it slows down again over time. Must be something is causing the work for the linting process to pile up every time it runs? Based on how the highlighted errors change throughout the process, it's as if it's trying to lint every previously linted version of the file. Issue also seems way more pronounced on my linux laptop than on my powerful windows desktop. I hope this gets fixed soon, it's been bugging me for too long.
This doesn't work for me on mac :/
Edit: Instead vscode is taking 100% CPU after restarting extension host.
I'll make a setting that disables codeActions
in Vetur. Try it and let me know if the situation improves.
I'll make a setting that disables
codeActions
in Vetur. Try it and let me know if the situation improves.
Waiting up..
How about disabling eslint code action from eslint in Vue files? Keeping only vetur actions.
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"[vue]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": false
}
},
}
Would that help? I tried on my local, will report soon.
It seems to work and keep both extensions at bay.
Caveat: template autofix will not be proceeded.
@elevatebart So in your case it's ESLint hanging up, not Vetur, is that correct?
It's the two waiting for each other I believe.
May be this isn't the expected solution but I managed to fix it by resetting all the stuff.
-
Take backup of your settings.json
-
Remove all extensions and restart vscode (In my case, I removed Vetur, EsLint, Go, Beautify, TODO)
-
Install all the extensions again
-
Open User Settings -> Search for Formatters
-
Select Vetur -> Format -> Default Formatter (HTML)===> Change default to prettier
-
Go to Prettier config and Make sure no boxes are checked
and done !
Above steps fixed Vue Formatting for me,. (It does not get stuck on loading now)..
@imtiyazs This doesn't fix the issue, I have reinstalled and cleaned my settings a few times already. The issues can be triggered when dealing with multiple formatting issues. Downgrading does make it trigger less, but still it seems to happen because some extensions seem to waiting for each other.
@imtiyazs This doesn't fix the issue, I have reinstalled and cleaned my settings a few times already. The issues can be triggered when dealing with multiple formatting issues. Downgrading does make it trigger less, but still it seems to happen because some extensions seem to waiting for each other.
Um.. Pretty hard to find exact scenario. I faced this issue in one of the repo. After switching the repo, the extensions worked perfectly (Without any change in settings). Later, I followed above steps for the same problematic repo and extensions started working perfectly like before..
One important thing, I changed default formatters of Vetur that made it work perfectly. You can check above images 4,5 and 6.
Is there any resolution ? It's seems that my vscode is awayls being blocked by this.
Is there any resolution ? It's seems that my vscode is awayls being blocked by this.
Can you try these settings?
{ "eslint.alwaysShowStatus": true, "editor.defaultFormatter": "esbenp.prettier-vscode", "html.format.contentUnformatted": "", "javascript.format.enable": false, "eslint.options": { "extensions": [".html", ".js", ".vue", ".jsx"] }, "editor.codeActionsOnSave": { "source.fixAll.eslint": true }, "editor.fontFamily": "Fira Code, Menlo, Monaco, 'Courier New', monospace", "editor.fontLigatures": true, "editor.fontSize": 14, "window.zoomLevel": 0, "vetur.format.defaultFormatter.js": "vscode-typescript", "vetur.format.defaultFormatter.html": "prettier", "javascript.format.insertSpaceBeforeFunctionParenthesis": true, "explorer.confirmDelete": false, "git.autofetch": true, "editor.formatOnSave": true }
with formatting ;):
{
"eslint.alwaysShowStatus": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"html.format.contentUnformatted": "",
"javascript.format.enable": false,
"eslint.options": { "extensions": [".html", ".js", ".vue", ".jsx"] },
"editor.codeActionsOnSave": { "source.fixAll.eslint": true },
"editor.fontFamily": "Fira Code, Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": true,
"editor.fontSize": 14,
"window.zoomLevel": 0,
"vetur.format.defaultFormatter.js": "vscode-typescript",
"vetur.format.defaultFormatter.html": "prettier",
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"explorer.confirmDelete": false,
"git.autofetch": true,
"editor.formatOnSave": true
}
@elevatebart @imtiyazs thanks! I restart my mac and it's ok. Next time i will try the setting. 🤝🤝 But the strange thing is that i have more than one vscode running, but only one has problem and they use the same setting 😂😂
@elevatebart @imtiyazs thanks! I restart my mac and it's ok. Next time i will try the setting. 🤝🤝 But the strange thing is that i have more than one vscode running, but only one has problem and they use the same setting 😂😂
Yea, that's what I mentioned few comments above.. The behaviour depends on your workspace or project folder too..
Someone gave me a hint about auto closing tags. That few auto closing tags might create issue for linters. However, didn't get any chance to test that.
I added vetur.languageFeatures.codeActions
. Try turning it off in the new version to see the issue still happens. If this is the cause I'll investigate further.
I added
vetur.languageFeatures.codeActions
. Try turning it off in the new version to see the issue still happens. If this is the cause I'll investigate further.
hi,octref, thank you very much for your work. But i can't find the version of 0.28.0
in my vscode, is it published?