CodinGame / monaco-vscode-api

VSCode public API plugged on the monaco editor
MIT License
205 stars 29 forks source link

Using themeserviceoverride with an own tokenizer causes runtime-errors #408

Closed mep-bsw closed 1 month ago

mep-bsw commented 2 months ago

grafik i think this happens if theres is no matching theme-data associated with the returned tokens from my own tokenizer.

this error only comes up when using themeserviceovveride together with monaco.languages.setTokensprovider.

Im rather new to this, so please feel free to educate me on this, if im wrong.

CGNonofr commented 2 months ago

Your problem is that the TokenizationSupportAdapter takes the theme service as parameter and directly infer it's the standalone (monaco) implementation, which is not when using the theme service override

Note that it seems to be an issue only for the TokensProvider, not the EncodedTokensProvider

Out of curiosity, what is the tokenizer you're trying to implement?

mep-bsw commented 2 months ago

im implementing my own tokenizer for a very obscure and specific dsl. thanks for the info ^^

mep-bsw commented 2 months ago

so in order for my tokens to receive coloring, i must register a theme with customTokenColors and use the encodedtokensprovider, if i wish to also have a vscode-theme?

CGNonofr commented 2 months ago

I'm not sure I will be able to help you on this specific topic

But If you're able to use a textmate grammar instead of implementing the tokenizer by hand, it would probably be simpler

github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 month ago

This issue was closed because it has been inactive for 14 days since being marked as stale.