-
-
Notifications
You must be signed in to change notification settings - Fork 410
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
Support for incremental tokenization #419
Comments
Out of curiosity: what would be the use case for incremental tokenization? |
My use case would be building a new editor, I can't stop the world when tokenizing a document, and I can't restart tokenization from scratch when a new line is appended to the document, for example. |
So your use case is around general tokenization of a given string/line of code based on a tmLanguage definition, and not (static) syntax highlighting? |
Yes. |
Realistically shiki is too high level of an abstraction for you to do that, you're probably wanting to use the APIs from vscode-oniguruma & vscode-textmate yourself |
Makes sense, thanks 👍 |
I'd say look into tree-sitter. |
Tree-sitter is interesting, but it doesn't support as many grammars as TextMate and the syntax highlighting would be slightly different compared to vscode, which I guess would be undesirable, even if it's slightly better. I'd like to add support for both eventually though, for the moment I've only wired textmate grammars in. |
@fabiospampinato VS Code started to implement this feature: microsoft/vscode#210475 |
It'd be very interesting for some applications if Shiki supported tokenizing incrementally, basically something that editors like vscode might want to use.
The text was updated successfully, but these errors were encountered: