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

EncodedTokensProvider? #11

Open
vasiltabakov opened this issue Nov 30, 2019 · 5 comments
Open

EncodedTokensProvider? #11

vasiltabakov opened this issue Nov 30, 2019 · 5 comments

Comments

@vasiltabakov
Copy link

Do you plan supporting EncodedTokensProvider?

@zikaari
Copy link
Owner

zikaari commented Nov 30, 2019

What is your use case?

@vasiltabakov
Copy link
Author

I'm still researching what exactly the encoded token provider strategy is about. So far it seems to me that using encoded tokens could lead to faster processing of tokens in the editor. So my goal is to find out if using encoded tokens would lead to a faster editor experience.

I've tried implementing it, but it didn't work. The grammars did return tokens in binary format but they didn't seem correct. One of the visible results was that the colorization in the editor was all gone.

So I thought asking, maybe you would know more since this is a textmate thing related to tokenization and I'm not too familiar with either.

@zikaari
Copy link
Owner

zikaari commented Dec 5, 2019

Encoded tokens only work when tokenizer is given a theme object, after which the color values are returned directly instead of token names ( or scopes).

In case of monaco editor, one we don't have access to the theme, and two it doesn't accept color values directly but instead semantic token/scope names (and that too is very hacky)

@vasiltabakov
Copy link
Author

In monaco you can define your own theme passing it an IStandaloneThemeData object, would that be enough? I tried following some of the code of vscode and so implementing encoded tokenization won't be straightforward. I'll update the issue if I find a working solution.

@bolinfest
Copy link

@NeekSandhu @vasiltabakov

I just got a demo working that uses vscode-textmate and vscode-oniguruma. It leverages EncodedTokensProvider:

https://github.com/bolinfest/monaco-tm/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants