-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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
open the php file will crash the editor #40279
Comments
I can confirm this bug. The window will freeze and after a few seconds the message appears: |
I'm still on 1.18.1 and get the same. vscode-textmate endless loop? |
Also reproes with latest grammar. Atom handles it fine. @aeschli I don't know where to start debugging this? |
may be the php syntax highlight tigger this bug. if rename the test.php to test.js or other language is fine. |
That's what I expect. |
@alexandrudima Looks like an issue in https://github.com/Microsoft/vscode-textmate. |
Probably PHP has a regex that is very very slow on this particular string. One could debug by editing the oniguruma C++ code and logging every regex search call. |
FYI, I get a similar freeze (infinite processing) when opening I logged #42117 (not sure if it's a duplicate). |
The regex that causes the freeze is Interstingly it works in Atom, so maybe there is some trick we miss in vscode-textmate. I created microsoft/vscode-textmate#59 @roblourens As a workaround I suggest to massage the regex to remove |
Thanks for investigating @aeschli! I'm curious, did you find it by building Oniguruma, or were you able to find it another way, by bisecting the grammar or something? |
And this very similar regex doesn't trigger it, which is interesting: |
@roblourens: @alexandrudima showed me how to add debug statements to oniguruma:
|
Ok, sounds straightforward enough, thanks. |
Steps to Reproduce:
test.php file
Reproduces without extensions: Yes/No
The text was updated successfully, but these errors were encountered: