-
Notifications
You must be signed in to change notification settings - Fork 54
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
Typing in img onLoad causes vs code helper to spike to 100% cpu usage. #70
Comments
I'm also seeing 100% CPU spikes when using this extension. Probably an infinite loop somewhere; it causes other extensions (e.g. ESLint) to stop working until the extension host process is killed. I've disabled almost all my extensions to narrow it down; CPU blow-up ceases to occur if I disable this one. |
@DDKnoll @atombender If you disable all other extensions and only enable this extension, isthe CPU usage still high? |
@formulahendry I have work to do, and many extensions I need to be productive, so that has not been an option. What I did was the reverse: I disabled extensions, one by one, until the problem stopped. I just enabled the extension again, removed a closing tag in one of my React JSX files, and CPU went up to 100%. I was able to reduce the test case to this:
Hitting the "auto close tag" keyboard shortcut with the caret at the end of the
|
Thanks @atombender for the code snippet! |
My first gut feeling is that the core regex of the extension has a case of catastrophic backtracking. Playing around with it on regex101.com might help find the issue more easily. As you can see it times out with the short snippet in @atombenders comment It would help to deconstruct the regex more, I admit not fully understanding every part, but by fudging around I found that removing the @formulahendry could you deconstruct/explain this part? |
Any update? With the March release of VSCode (1.22.1) I constantly ran into the above issue. Hence I had to disable the extension in the end. |
@DDKnoll I bet you're using SublimeText mode? It's frequently crashing with it, maxing CPU usage I guess the infinite loop is in |
certainly fixed by #87 |
For some reason, typing inside of the
<img onLoad={typehere}/>
jsx tag immediately causes my CPU to spike to 100% and freezes the editor for about 5 seconds. Disabling this extension fixes the issue.The text was updated successfully, but these errors were encountered: