Hi
These days I’m playing with CodeMirror v6.
My goal is to provide JS-like syntax highlighting/autocompletion inside mustache html templates inside curly braces.
Initial idea was to adjust lezer-html to make it treat content inside curly braces by nested js parser as if it was javascript (mustache is less powerful than generic javascript, but this would still work for me).
So I added
mustache { "{{" nest.jsParser "}}" }
into lezer-html grammar entities just to realize that my mustache extension should work over html grammar and have higher priority. E.g. it should blend into text, it could blend across html elements / attributes whatever.
After playing a while with lezer-html parser grammar I concluded that I don’t quite get the way to accomplish my goal.
Found some brief pre-v6 example with overlay parsers CodeMirror: Overlay Parser Demo — maybe you have some extension points in mind to share that I don’t see yet or give some advice how would you start with that.
Thanks!