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

[Bug] Setting maxTokenizationLineLength has no effect #3025

Closed
1 of 2 tasks
jonatanklosko opened this issue Mar 18, 2022 · 1 comment · Fixed by microsoft/vscode#145979
Closed
1 of 2 tasks

[Bug] Setting maxTokenizationLineLength has no effect #3025

jonatanklosko opened this issue Mar 18, 2022 · 1 comment · Fixed by microsoft/vscode#145979
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug tokenization

Comments

@jonatanklosko
Copy link
Contributor

jonatanklosko commented Mar 18, 2022

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Code

monaco.editor.create(document.getElementById('container'), {
  value: "[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]",
  language: 'javascript',
  maxTokenizationLineLength: 4,
});

Actual Behavior

The line gets tokenized and highlighted.

Note: when hovering over the line it actually says that tokenization was skipped.

Expected Behavior

Tokenization should be skipped.

Additional Context

The default maxTokenizationLineLength value is 20_000. When I paste a longer line into https://vscode.dev it isn't highlighted, however it gets highlighted in the Monaco playground.

Since Monaco handles highlighting separately, my guess would be that this option is not taken into account.

The on-hover messages is added here (for both Monaco and VSCode) and the TextMate tokenization is skipped here.

@Lazyuki
Copy link

Lazyuki commented Mar 31, 2022

This is causing monaco-editor to freeze up the entire UI for several seconds making the browser unresponsive when it's tokenizing a log line containing 50k+ characters. I have a number of custom tokenizers that aren't cheap so ideally monac-editor should respect the maxTokenizationLineLength and skip lines that are too long.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 14, 2022
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 tokenization
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants