Skip to content
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

Getting code actions from ''Vetur', 'Eslint'' takes too long! #2150

Open
3 tasks done
daolanfler opened this issue Aug 12, 2020 · 71 comments
Open
3 tasks done

Getting code actions from ''Vetur', 'Eslint'' takes too long! #2150

daolanfler opened this issue Aug 12, 2020 · 71 comments

Comments

@daolanfler
Copy link

daolanfler commented Aug 12, 2020

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

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:
image
even though the change is very mirror. I have to downgrade to 0.25.0 to avoid this !

local eslint version is eslint@6.8.0
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

@shiyu3169
Copy link

shiyu3169 commented Aug 12, 2020

I meet the same issue on Win as well. Downgrading to 0.25.0 temporarily solve problem

@yoyo930021 yoyo930021 added the bug label Aug 12, 2020
@AceYangWQ
Copy link

I have the same problem, too

@sethidden
Copy link
Contributor

sethidden commented Aug 14, 2020

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']

@rs3d
Copy link

rs3d commented Aug 15, 2020

@3nuc This happens for me sometimes, when I cancel the long running action. Maybe eslint/prettier related?

@francoism90
Copy link

francoism90 commented Aug 20, 2020

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.

@octref
Copy link
Member

octref commented Aug 26, 2020

  • Does this reproduce when you only have Vetur extension enabled? (Especailly with ESLint disabled)
  • Does setting "eslint.codeActionsOnSave.mode": "problems" help?

@sqal
Copy link

sqal commented Aug 28, 2020

@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.

@borie88
Copy link

borie88 commented Sep 3, 2020

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

@bbugh
Copy link

bbugh commented Sep 4, 2020

I'm not sure, but it seems to be related to this issue microsoft/vscode#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.

@francoism90
Copy link

@octref Just to confirm here the setting doesn't fix the 'Getting code actions from..' hang.

@imtiyazs
Copy link

imtiyazs commented Sep 9, 2020

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.

@Doeke
Copy link

Doeke commented Sep 9, 2020

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.

@imtiyazs
Copy link

imtiyazs commented Sep 9, 2020

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.

@octref
Copy link
Member

octref commented Sep 9, 2020

I'll make a setting that disables codeActions in Vetur. Try it and let me know if the situation improves.

@imtiyazs
Copy link

imtiyazs commented Sep 9, 2020

I'll make a setting that disables codeActions in Vetur. Try it and let me know if the situation improves.

Waiting up..

@elevatebart
Copy link

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.

@elevatebart
Copy link

It seems to work and keep both extensions at bay.

@elevatebart
Copy link

Caveat: template autofix will not be proceeded.

@octref
Copy link
Member

octref commented Sep 12, 2020

@elevatebart So in your case it's ESLint hanging up, not Vetur, is that correct?

@elevatebart
Copy link

It's the two waiting for each other I believe.

@imtiyazs
Copy link

May be this isn't the expected solution but I managed to fix it by resetting all the stuff.

  1. Take backup of your settings.json
  2. Remove all extensions and restart vscode (In my case, I removed Vetur, EsLint, Go, Beautify, TODO)
  3. Install all the extensions again
  4. Open User Settings -> Search for Formatters

Screenshot 2020-09-13 at 12 12 47 PM

  1. Select Vetur -> Format -> Default Formatter (HTML)===> Change default to prettier

Screenshot 2020-09-13 at 12 13 18 PM

  1. Go to Prettier config and Make sure no boxes are checked

Screenshot 2020-09-13 at 12 14 25 PM

and done !

Above steps fixed Vue Formatting for me,. (It does not get stuck on loading now)..

@francoism90
Copy link

francoism90 commented Sep 13, 2020

@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
Copy link

imtiyazs commented Sep 14, 2020

@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.

@way2ex
Copy link

way2ex commented Sep 16, 2020

Is there any resolution ? It's seems that my vscode is awayls being blocked by this.

@gregveres
Copy link

It seems to be saving without the warning coming up and it doesn't seem to be corrupting the file. So it looks like it is fixed. I will keep an eye out over the next few days. Thank you very much for your work on Vetur!

@sqal
Copy link

sqal commented Nov 3, 2020

0.29.0 nothing has changed for me :(

@hendrikbunnick
Copy link

0.29.0 does not help with the VueServerMain getting stuck at 99% CPU, as soon as vetur activates.
Im Still Stuck using the older versions.
:/

@sqal
Copy link

sqal commented Nov 3, 2020

@hendrikbunnick may I ask which version works best for you?

@hendrikbunnick
Copy link

@sqal im using 0.25.0.

@yoyo930021
Copy link
Member

yoyo930021 commented Nov 3, 2020

0.29.0 does not help with the VueServerMain getting stuck at 99% CPU, as soon as vetur activates.
Im Still Stuck using the older versions.
:/

If you can provide a repro case, we can debug it.
Please read https://github.com/vuejs/vetur/blob/master/.github/NO_REPRO_CASE.md and open a new issue.

If you don't want to make it public, you can email me directly.

@shiyu3169
Copy link

shiyu3169 commented Nov 5, 2020

0.29.0 doesn't fix it for me as well

@hendrikbunnick
Copy link

0.30.0 seems to be working for me.

@stijnjanmaat
Copy link

0.30.2 is not working for me, still the same issues as after 0.25.0

@yoyo930021
Copy link
Member

0.30.2 is not working for me, still the same issues as after 0.25.0

#2150 (comment)

@yoyo930021 yoyo930021 reopened this Nov 17, 2020
@m4rvr
Copy link

m4rvr commented Nov 19, 2020

I don't think it's a problem with Vetur but with VS Code. Getting the same popup every time I save and it's just a simple TypeScript & ESLint project.

@just-Bri
Copy link

@MarvinRudolph there's this issue which has been open for a while as well:
microsoft/vscode-eslint#1055

@nicooprat
Copy link

ESlint fixes were instantaneous on every files except .vue ones. Solved it with this setting: "vetur.validation.script": false,

@rnenjoy
Copy link

rnenjoy commented Apr 9, 2021

Been working to fix this for 5 days now. Saving.. Getting code actions from "Vetur", "Eslint" on my monrepo takes alot of time.

[Trace - 13:38:41] Received response 'textDocument/codeAction - (7)' in 276674ms.
[Trace - 13:38:42] Sending request 'textDocument/formatting - (16)'.

[Trace - 13:39:50] Received response 'textDocument/hover - (8)' in 340344ms.
[Trace - 13:39:50] Received response 'textDocument/hover - (9)' in 340145ms.
[Trace - 13:39:50] Received response 'textDocument/hover - (10)' in 337802ms.
[Trace - 13:39:50] Received response 'textDocument/hover - (11)' in 337293ms.
[Trace - 13:39:50] Received response 'textDocument/hover - (12)' in 335211ms.
[Trace - 13:39:50] Received response 'textDocument/hover - (13)' in 332737ms.
[Trace - 13:39:50] Received response 'textDocument/hover - (14)' in 328641ms.
[Trace - 13:39:50] Received response 'textDocument/documentSymbol - (15)' in 118920ms.
[Trace - 13:39:52] Received response 'textDocument/formatting - (16)' in 70220ms.
[Trace - 13:39:52] Sending notification 'textDocument/didSave'.

@yoyo930021
Copy link
Member

Been working to fix this for 5 days now. Saving.. Getting code actions from "Vetur", "Eslint" on my monrepo takes alot of time.

[Trace - 13:38:41] Received response 'textDocument/codeAction - (7)' in 276674ms.
[Trace - 13:38:42] Sending request 'textDocument/formatting - (16)'.

[Trace - 13:39:50] Received response 'textDocument/hover - (8)' in 340344ms.
[Trace - 13:39:50] Received response 'textDocument/hover - (9)' in 340145ms.
[Trace - 13:39:50] Received response 'textDocument/hover - (10)' in 337802ms.
[Trace - 13:39:50] Received response 'textDocument/hover - (11)' in 337293ms.
[Trace - 13:39:50] Received response 'textDocument/hover - (12)' in 335211ms.
[Trace - 13:39:50] Received response 'textDocument/hover - (13)' in 332737ms.
[Trace - 13:39:50] Received response 'textDocument/hover - (14)' in 328641ms.
[Trace - 13:39:50] Received response 'textDocument/documentSymbol - (15)' in 118920ms.
[Trace - 13:39:52] Received response 'textDocument/formatting - (16)' in 70220ms.
[Trace - 13:39:52] Sending notification 'textDocument/didSave'.

Wow, is it a big project?
What size is your project?

@ninofiliu
Copy link

I wrote a guide about a simple workaround

@codeime
Copy link

codeime commented Jun 26, 2021

@webdevnerdstuff
Copy link

Just starting having this same exact problem as of Sunday. Last Friday I did not have the problem.

@webdevnerdstuff
Copy link

Still having this problem. I tried to downgrade both Vetur and ESLint and still had the problem, but a tiny bit less. Then I decided to completely disable ESLint and remove all of its relevant settings from my settings file. The problem was just as bad. So I'm thinking this is definitely more a problem with Vetur than ESLint, because otherwise why would this error happen when ESLint is completely disabled?

@octref @yoyo930021 Is anybody even looking at this problem anymore? If you want a repo where I have been having this problem, I can provide you access to it. I already have ESLint looking at the same repo to try to problem solve on their side.

@webdevnerdstuff
Copy link

So out of frustration between constant errors, and authors of both extensions not responding to anybody (or any issues for that matter) for many weeks, I completely disabled Vetur and all of its settings were removed. I then installed other extension to get syntax highlighting and formatting. I'm still having the same problem showing up.

That leads me to believe it's ESLint that's the problem, not Vetur. Perhaps Vetur has it's own problem with this as well, but I know for sure that with it turned off I still have the problem.

@francoism90
Copy link

I don't know if it helps, but it's indeed eslint taking a long time to process and not Vetur. After switching to TS, Airbnb and the latest depends the problem disappeared.

I'm using Quasar and it seems their default present offers a good config when using Vetur as well.

@yoyo930021
Copy link
Member

Still having this problem. I tried to downgrade both Vetur and ESLint and still had the problem, but a tiny bit less. Then I decided to completely disable ESLint and remove all of its relevant settings from my settings file. The problem was just as bad. So I'm thinking this is definitely more a problem with Vetur than ESLint, because otherwise why would this error happen when ESLint is completely disabled?

@octref @yoyo930021 Is anybody even looking at this problem anymore? If you want a repo where I have been having this problem, I can provide you access to it. I already have ESLint looking at the same repo to try to problem solve on their side.

I can take a look.
In fact, so far I have not found any possible reasons.

@ninofiliu
Copy link

ninofiliu commented Jan 27, 2023

@webdevnerdstuff @francoism90 eslint is not the issue, it's either vetur or the eslint extension, because when running things from the command line instead of asking vetur to manage stuff, things go fast

Here's a fix #2150 (comment)

@lolik9l
Copy link

lolik9l commented Feb 21, 2023

The solution that worked for me:
I saw that I had an extension: "Vue Language Features (Volar)" and it had conflicts with the Vetur extension, disabling the latter helped.
image

@hghristov
Copy link

After updating to 0.37.2 it started happening to me too. Downgrading to 0.36.1 fixed it.

@parakawa
Copy link

I had the same problem, just reload the Vetur package (in the vscode extensions list) and it worked

@kazudeath1
Copy link

kazudeath1 commented May 23, 2023

After updating to 0.37.2 it started happening to me too. Downgrading to 0.36.1 fixed it.

Among the four Nuxt v2 repositories, this problem occurred in only one.
It was solved using the method above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests