-
Notifications
You must be signed in to change notification settings - Fork 342
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 ''ESLint'' #1055
Comments
Without a reproducible case this is very hard to track down. Almost all cases I have seen so far result in high CPU usage in the eslint npm module itself. To verify that you could use the setting Can you provide me with a GitHub repository I can clone that demos what you are experiencing. |
@dbaeumer Unfortunately I can't share the project but let me try with debug info. |
@h3xsoul thanks. Let me know what you find out. Dirk |
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines. Happy Coding! |
I've having the same issue on a couple of repositories regularily. One of the repositories where I can reproduce it always is EUI. Just opening that project and trying to save a file a couple of times, usually from around the 5th saving on it'll always be in that state where it's stuck in the "Getting code actions from ESLint" phase. When I hit saving in the stuck mode, no new lines will appear in the log. I know that other people working on that repository are having the same issue, so I hope with that above repo it should be easily reproducible. I've also enabled all other checks, to make sure it's really stuck on the ESLint check and not one of the TypeScript code actions. It seems to happen OS independent (fails at least on Linux and Mac). Please let me know if I can provide any additional information. |
@timroes actually the trace is helpful. It shows that the linting hangs in the ESLint npm library. The |
@timroes I tried to reproduce this using the repository you pointed out. Any more steps you can provide (e.g. which file to save and what to type beforehand) |
@dbaeumer for me it happens pretty regularily. I e.g. just edited the |
Happens pretty regularly to me too, with the message ': Getting code actions from ''ESLint', 'TypeScript Importer'' (configure)' I tried disabling the ts import plugin but it didnt solve the issue. |
@timroes I tried again with the repository you provided but without any success. But I have to say I didn't make any meaningful changes. Not an expert in the code. When this happens to you the next time could you provide me with the content of the file when it gets stuck. May that helps to track this down. |
And two general question
|
I can attest to @timroes' problem as I personally had the same issue with the same repository a while back. It would definitely throttle my CPU and I'd always have click "Cancel" where it would skip the auto-formatting and then save the file. I can't remember exactly what my previous configuration in my settings file was, though something similar to what the OP pasted. I removed all of those configs and I now just have the following relevant settings: "editor.formatOnSave": true,
"eslint.format.enable": true,
"editor.defaultFormatter": "esbenp.prettier-vscode" The editor saves and formats on save properly now. |
I believe all of you that you see this. But without me being able to reproduce it there is very little I can do. So if someone has steps please provide them here. Or if someone is willing to debug please ping as well. I can provide steps on how to do this. |
@dbaeumer Happy to debug with your guidance. I can consistently trigger the hanging issue with any change right now so I'm not sure I can provide an repro steps other than "try saving a file..." I'll hold off making @cchaos's recommended config changes for a few days so that I don't risk changing anything before getting to the bottom of this. |
@myasonik thanks for your willingness to debug this. Highly appreciated. Here are the steps:
When you hit the problem go back to the first instance of VS Code
Can you then provide me with the call stack. I will then see what additional information we can obtain to be able to reproduce this. |
I am having "excessive saving issues", in the form that I hit "save" very very often while typing (like a couple of times per minutes). Sometimes I guess I hit it when the code is not even in a compilable state. I wonder if that could be related to that issue, because I had - while watching this behavior over the weekend - the feeling it happens more often when it's trying to reformat (prettier via eslint) in a state, where the code is not actually parseable. Sorry, haven't had the time to really debug it, but maybe @myasonik this can help reproducing this. |
Welp, I finally got around to this and I can't reproduce it after being able to reproduce it consistently for two days. (And I haven't touched the repo nor any settings in since then.) Banged at it for nearly an hour with no luck. The only trace I could get is this one though it seems to just be a warning that wasn't causing any issues...
|
Just stopping by to say I have this same message popup almost every time I save a .tsx file in a React project. I tried adding/removing options from the settings.json:
Tried enabling/disabling each of those but nothing changes the behaviour. |
@myasonik thanks a lot for trying!! @reifnotreef can you share that repository with steps to reproduce? |
Unfortunately no, it's a private work repo. My first guess is a specific setting we have but I haven't been able to find anything that would cause it in our config files etc. |
At this point in time, it doesn't seem to get stuck anymore (latest vscode, eslint or just the act of upgrading did it?) |
My current, relevant, settings are:
I did make sure that I have the latest prettier/eslint via npm i -g. |
Can really no one share a repository with me we I can reproduce this? |
The repo that some of us have been having trouble with this in is https://github.com/elastic/eui |
@cchaos @myasonik I'd be curious if it happens to you after the latest VSCode upgrade still. I've upgraded last week and worked the weekend on a project, where it didn't happen that often as in EUI, but still often enough to notice, and I haven't had a single issue ont he whole weekend in that repo. But haven't checked yet if it also disappeared for EUI, maybe one of you already tried with the new VSCode version. |
I again played with https://github.com/elastic/eui without success. @cchaos which file are you usually editing when you see this. |
Confirming this issue is still happening for me. Here is my settings.json
|
This is a daily chore issue for me, doesn't matter what project - it just crashes vscode. |
@michealroberts have you tried to use the |
I am seeing this never complete. I left it running all night ~8hrs and I still see the "Getting code actions" busy dialog. Started happening after I updated vscode to 1.71.0 It had always worked before that for me. |
@chrismcleod what happens if you set |
@dbaeumer in the process of trying to make a demo repo I figured out my issue at least. I have m1 Mac and home-brew puts things in /opt/homebrew. I saw a stack overflow that had recommended to fix a problem with Xcode, I should symlink node into /usr/local/bin. Not only did that break eslint plugin, but it also broke a npm install and a bunch of other stuff. I deleted that symlink and it works again. |
I was able to get this working by deleting my local git remote by running Lmk if anyone else has success trying this. |
@chrismcleod good to hear you got it working again. |
Disabling "Local History" plugin worked for me. It made the workspace extremely large |
I have always had this problem, but I think it may have nothing to do with the vscode eslint plug-in, because I have the same problem when I switched to webstrom. Maybe it's an eslint's own problem? |
What always help to track this down is to run the extension with |
Hi @dbaeumer , thanks for this awesome extension. It's working great apart from this issue. Here is the full output (avoiding pasting it all here for readability) Here's the relevant part (segment where you can see the slowdown):
As you can see, while loading rules it starts linting the file that's open, and it lasts for 25 seconds. After that first run, everything works well. Just this first run is extremely slow and file save hangs until it's done. I tried disabling Here's my eslintrc and here's the .vscode/settings.json if it helps. Edit: I'm in a monorepo with root tsconfig, and then each package extends that tsconfig (same patter with root eslintrc and per-package eslintrc files which extend it). If I just scope the root tsconfig to one package - it works extremely quickly (like 1 second vs 25 seconds)! But this seems like a bug, why would the extension try to read the whole repo instead of the context of just one file I'm working in? |
@kredenac The VS Code ESLint extension depends for validation fully on the ESLint npm package (https://eslint.org). By default the ESLint extension doesn't consult any tsconfig.json files. This happens to my knowledge only when using the TypeScript plugins for ESLint. There is an option in the ESLint TypeScript plugin to tell for each folder which tsconfig files to use. I do this for this repository for example as well. You might want to have a look at https://github.com/microsoft/vscode-eslint/blob/main/client/.eslintrc.json#L4 to see how this works. In general if the ESLint npm module is slow (e.g. like in your trace) the best you can do to track this down is to use ESLint in a terminal (without VS Code) since it will show the same behavior and is easier to tweak. |
@kredenac you might also want to make use of the |
Even I was facing the same issue in multiple repos in react project (using multiple TS-ESLint plugins). Rolling back to ESLint |
Here's how I consistently fix this hanging issue:
My hunches:
|
Happening on my Mac as well. This is very much irritating |
I'm also facing the same issue. |
@NumanAnees, @JakeRuth @dhwrwm have you followed the steps in #1344 to understand what is slow. |
Requiring issue to be reopended because many seems to be facing the issue still Me included |
@MarArMar have you followed the steps in #1344 to understand what is causing this. I most cases so far the slowness is caused by a slow ESLint rule which I can't do anything about it. If you see the slowness somewhere else can you please open a new issue with a GitHub repository I can clone that demos the problem. Otherwise it is hard to tell what is causing this. |
@dbaeumer Ok I added some comment to help with implementing one of your suggestions there, will report if still experiencing problems Have a great day |
This started happening for me again today. |
Disabling the Biome and ESLint extensions made saving fast again. |
Ok I believe for me @dbaeumer solution worked or at least I experienced the problem less 👍 |
Had the same issue - I think it's Github copilot chat. I can see their icon go to a spinner when I hit save, and never back again. The issue here is disabling an extension reloads the extension host, which fixes the problem for a bit, so its hard to debug. Would love some data on what extension is holding things up |
Issue Type: Performance Issue
I got a performance regression after an update of VSCode insider, not sure which version was working fine, updated on 08.26.2020 - 08.27.2020. Today decided to report an issue.
I found a couple of similar problems:
#999
microsoft/vscode#102956
settings.json
ESlint node module version: v6.8.0 (didn't change)
Extension version: 2.1.8
VS Code version: Code - Insiders 1.49.0-insider (6384e3246884694cbc34eacc70281ada15e2c7f2, 2020-08-28T16:02:16.834Z)
OS version: Darwin x64 19.6.0
System Info
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Process Info
Workspace Info
The text was updated successfully, but these errors were encountered: