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

.rst (restructured text) files freezes the page #2484

Closed
AlexandraVarfolomeyeva37 opened this issue May 17, 2021 · 2 comments · Fixed by microsoft/monaco-languages#141
Closed
Labels
bug Issue identified by VS Code Team member as probable bug grammars help wanted Issues identified as good community contribution opportunities
Milestone

Comments

@AlexandraVarfolomeyeva37

Reproduces at the Monaco Editor homepage:
-- https://microsoft.github.io/monaco-editor/
Browser: Edge, Chrome
OS: Windows 10
Playground code that reproduces the issue:
Restructured file:

some property = Text::ProxyLibrary::ProxyInterfaceTest::DeleteProxyInterface();

Causes the UI to become unresponsive or event to freeze and after some time web browser pops up a modal dialog “Page isn’t responding - Wait - Exit Page”.
image

In a long file, it takes a lot of time to load even if you choose the wait option several times.

@alexdima
Copy link
Member

alexdima commented May 18, 2021

By breaking the JS execution, I could see the tokenizer is stuck on this rule -- https://github.com/microsoft/monaco-languages/blob/319a1ddf568438d59a3851784b092cdf1f88e29e/src/restructuredtext/restructuredtext.ts#L127 . It looks like that particular regular expression is suffering from catastrophic backtracking. cc @qwefgh90

We are more than welcoming a PR by the community!

@alexdima alexdima added bug Issue identified by VS Code Team member as probable bug grammars help wanted Issues identified as good community contribution opportunities labels May 18, 2021
@qwefgh90
Copy link
Contributor

qwefgh90 commented May 19, 2021

I will figure out how this bug can be fixed. And there is another rule to freeze the page -- https://github.com/microsoft/monaco-languages/blob/319a1ddf568438d59a3851784b092cdf1f88e29e/src/restructuredtext/restructuredtext.ts#L141.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug grammars help wanted Issues identified as good community contribution opportunities
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants