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

RangeError: Maximum call stack size exceeded with recent vscode.html builtin extension #12434

Closed
marcdumais-work opened this issue Apr 19, 2023 · 0 comments · Fixed by #12463
Closed
Labels
bug bugs found in the application builtins Issues related to VS Code builtin extensions

Comments

@marcdumais-work
Copy link
Contributor

marcdumais-work commented Apr 19, 2023

Bug Description:

Since recently, vscode builtin "vscode.html" contributes a snippet, which trips Theia's snippet parser, throwing it into infinite recursion. The snippet appeared after v1.70.2, and we are noticing it for the first time with unreleased v1.72.2. This extension is tiny, contributing only a Textmate grammar and a snippet.

Here is the parser that goes into recursive loop when dealing with the contributed snippet:

protected parseSnippets(snippets: JsonSerializedSnippets | undefined, accept: (name: string, snippet: JsonSerializedSnippet) => void): void {
for (const [name, scopeOrTemplate] of Object.entries(snippets ?? {})) {
if (JsonSerializedSnippet.is(scopeOrTemplate)) {
accept(name, scopeOrTemplate);
} else {
this.parseSnippets(scopeOrTemplate, accept);
}
}
}

2023-04-19T16:39:20.368Z root INFO Changed application state from 'attached_shell' to 'initialized_layout'.
2023-04-19T16:39:20.440Z root INFO [a237a147-9f5a-4f0f-99d3-b1ff74376554] Sync of 2 plugins: 127.0 ms [Finished 2.093 s after frontend start]
2023-04-19T16:39:20.440Z root INFO [a237a147-9f5a-4f0f-99d3-b1ff74376554] Loading plugin contributions
2023-04-19T16:39:20.440Z root INFO [a237a147-9f5a-4f0f-99d3-b1ff74376554] Load contributions of 2 plugins: 21.0 ms [Finished 2.114 s after frontend start]
2023-04-19T16:39:20.481Z root WARN [a237a147-9f5a-4f0f-99d3-b1ff74376554][vscode.html]: Language for 'source.css' not found.
2023-04-19T16:39:20.482Z root WARN [a237a147-9f5a-4f0f-99d3-b1ff74376554][vscode.html]: Language for 'source.js' not found.
2023-04-19T16:39:20.482Z root WARN [a237a147-9f5a-4f0f-99d3-b1ff74376554][vscode.html]: Language for 'source.python' not found.
2023-04-19T16:39:20.482Z root WARN [a237a147-9f5a-4f0f-99d3-b1ff74376554][vscode.html]: Language for 'source.smarty' not found.
2023-04-19T16:39:20.526Z root ERROR RangeError: Maximum call stack size exceeded
    at Array.values (<anonymous>)
    at MonacoSnippetSuggestProvider.parseSnippets (http://localhost:3000/packages_monaco_lib_browser_monaco-frontend-module_js.js:3122:54)
    at MonacoSnippetSuggestProvider.parseSnippets (http://localhost:3000/packages_monaco_lib_browser_monaco-frontend-module_js.js:3127:22)
    at MonacoSnippetSuggestProvider.parseSnippets (http://localhost:3000/packages_monaco_lib_browser_monaco-frontend-module_js.js:3127:22)
    at MonacoSnippetSuggestProvider.parseSnippets (http://localhost:3000/packages_monaco_lib_browser_monaco-frontend-module_js.js:3127:22)
    at MonacoSnippetSuggestProvider.parseSnippets (http://localhost:3000/packages_monaco_lib_browser_monaco-frontend-module_js.js:3127:22)
    at MonacoSnippetSuggestProvider.parseSnippets (http://localhost:3000/packages_monaco_lib_browser_monaco-frontend-module_js.js:3127:22)
    at MonacoSnippetSuggestProvider.parseSnippets (http://localhost:3000/packages_monaco_lib_browser_monaco-frontend-module_js.js:3127:22)
    at MonacoSnippetSuggestProvider.parseSnippets (http://localhost:3000/packages_monaco_lib_browser_monaco-frontend-module_js.js:3127:22)
    at MonacoSnippetSuggestProvider.parseSnippets (http://localhost:3000/packages_monaco_lib_browser_monaco-frontend-module_js.js:3127:22)

Steps to Reproduce:

  1. Build the example application, browser or Electron, from the master branch
  2. Delete all extensions from folder ./plugins/. Unzip html-1.72.1.zip into it:
    html-1.72.1.zip
  3. Start example app. You should see a similar as above "RangeError: Maximum call stack size exceeded" exception

Additional Information

  • Operating System:
  • Theia Version:
@marcdumais-work marcdumais-work added bug bugs found in the application builtins Issues related to VS Code builtin extensions labels Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application builtins Issues related to VS Code builtin extensions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant