Skip to content

Suggest should not force tokenization in very large files #32508

@rebornix

Description

@rebornix

Related to #21564 and #30181 .

When we open a large file (or whose tokenization takes a long time), any feature that requires accurate token information runs model.forceTokenization and it blocks the UI, including

  • Paste (Auto Indent checks token info)
  • Enter (Enter rules or Indentation)
  • Type
    • (Auto Indent or electric chars)
    • Suggest (Suggestion and Snippet)
    • Others ?

Paste/Enter/Type relies on indentation/enter rules, right now I skipped the smart features if the tokenization is not yet ready for selections. But speaking of suggestions, some suggestion provider (like snippet) requires language id at position, some (quickSuggestions) requires token info, these two force tokenization for selection, which would lead to UI blocking.

Enable quick suggestion and snippet (default)

typeblock

Disable both of them by "editor.quickSuggestions": false, "editor.snippetSuggestions": "none"

typenoblock

Any component that requires token/language info can lead to the UI blocking when users open a large file and modify real quick. As we increase the file size limit for tokenization, this may happen more often. cc @alexandrudima @jrieken @ramya-rao-a

Metadata

Metadata

Assignees

Labels

editor-coreEditor basic functionality

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions