Currently there seems to be an issue with “subgrammars” f.ex. https://atom.io/packages/atom-jinja2 which has to redefine every file type with added jinja syntax (It doesn’t support a lot of files, for example
.groovy.j2). Same thing with ERB files etc.
Now it would be really cool to be able to say in the Jinja grammar
Compose with first extension and then
foo.groovy.j2 would get a composed Syntax of
Groovy - Jinja2 or
bar.html.erb would be
HTML - ERB.
The way it would work is that the file get’s both grammars applied to it
foo.groovy.j2 first applies Groovy grammar and the Jinja2 grammar and
baz.j2.groovy would first apply Jinj2 and then Groovy grammar. That way composing grammars have a way define how overrides work if necessary.
The grammar “API” could even have a
cannot override flag for parts of grammars, but that sounds only slightly useful.