microsoft / vscode-textmate

A library that helps tokenize text using Text Mate grammars.
MIT License
562 stars 108 forks source link

Clarification about concurrent tokenization using multiple themes #218

Open fabiospampinato opened 8 months ago

fabiospampinato commented 8 months ago

Registry.prototype.setTheme has this comment:

/**
 * Change the theme. Once called, no previous `ruleStack` should be used anymore.
 */

But, is that actually true if I always call setTheme with the same theme right before each tokenizeLine2 call? Or do I really need to basically create a dedicated registry for each theme that I've registered if I want to support tokenizing using different themes concurrently?