vetur: Getting code actions from ''Vetur', 'Eslint'' takes too long!

  • 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

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 61
  • Comments: 71 (12 by maintainers)

Commits related to this issue

Most upvoted comments

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.

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 meet the same issue on Win as well. Downgrading to 0.25.0 temporarily solve problem

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

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

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

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.

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.

@MarvinRudolph there’s this issue which has been open for a while as well:
https://github.com/microsoft/vscode-eslint/issues/1055

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!

The new version and disabling codeActions worked great!

PS: Restart VS CODE after disabling.

Vetur version 0.28.0

In my case, the repo is also a pretty big mono repo. In smaller projects, it works fine.

I get this issue right when Vetur is initializing in a large Project (eg. opening a .vue file), independent of Lint/codeAction Settings. VueServerMain gets stuck at 99% CPU usage and the Vue Language Server does not shut down, when VSCode is terminated.

This issue started for me when updating from 0.25.0 to 0.26.0

A Workaround for me is:

  1. Start VSCode on small Project Folder with a Single Vue File and let Vetur Initialize. (Top position in workspace list)
  2. Add “Folder to Workspace” containing the Large Project

I usually cd into project directory and boot up vscode via “code .” in the project folder, somehow vetur/vueServerMain seems to get overloaded this way.

vetur.languageFeatures.codeActions

Thanks! It working good for me now.

  1. I set "vetur.languageFeatures.codeActions": false
  2. Changed default formatter to prettier-eslint
  3. IT DIDNT WORK. GOT THE SAME ERROR.
  4. I set "vetur.languageFeatures.codeActions": true and again to false
  5. THEN IT STARTED WORKING PERFECT and now I am unable to reproduce it !

Lol. What’s happening?

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
}

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.

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

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

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

https://github.com/vuejs/vetur/issues/2150#issuecomment-721039861

#2374 might have fixed this. Please try the new version 0.29.0 when it’s out. If it’s not fixed, feel free to open a new issue.

Yes, I am using 0.28.0 and I restarted vscode before checking this setting. Are there any other steps/ settings I can enable to debug this issue? I tried to reproduce this issue in a newly created project but failed so far. I will keep trying.

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

I have the same problem, too