I’m currently working on a plugin for mermaid.js that provides highlighting for all of the mermaid diagram types as one of its core features. Rather than one giant language, I’ve been going about it by having one top-level mermaid language that injects the appropriate diagram-specific language based on the diagram type.
For the most part, this works fine although there are some rough edges around nested injected languages when it comes to markdown code fences.
The docs discussing lexer implementation touch on embedding languages using chameleon tokens that implement ILazyParseableElementType. I’m wondering what the practical differences are between embedding a language in this manner vs injecting language fragments using MultiHostInjector?