shikijs / shiki

A beautiful yet powerful syntax highlighter

Home Page:http://shiki.style/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add option to configure tokenizeMaxLineLength and tokenizeTimeLimit in @shikijs/monaco

floriansbh opened this issue · comments

Clear and concise description of the problem

Currently both of these settings are are statically set in the tokenize() function (tokenizeMaxLineLength to 20.000 and tokenizeTimeLimit to 500) and cannot be changed in any way. My problem is that I'm mostly dealing with bigger files which are most of the time minified and exceed the tokenizeMaxLineLength and tokenizeTimeLimit so I can't really get any syntax highlighting most of the time.

Suggested solution

Adding an argument for these settings to the shikiToMonaco() function exported by @shikijs/monaco or just making use of the options passed to the monaco.editor.create() function would probably be the most optimal solution

Alternative

No response

Additional context

No response

Validations

Contributes

  • If this feature request is accepted, I am willing to submit a PR to fix this issue

Sure, pr welcome!