Open baronfel opened 3 years ago
For what I've seen, the way to "customize" this is to have different patterns in a comment preceding the literal, like (* sql *)
or (* postgresql *)
. I used the function to make it less verbose, but we could check for a comment for extra fine-tuning. Like this extension that I was using at the beginning (but had to uninstall because it was messing with other code many times).
BTW, about embeddedLanguages
, they don't really seem to work. The highlighting is just activated when defining the content of the match as text.html.derivative
or source.sql
.
I'm not sure to what extent embedded languages could work with interpolated strings anyway. Their tooling wouldn't know how to deal with the holes. Perhaps worth investigating for HTML first.
As for custom languages would let postgresql = sql
work? Unfortunately due to a limitation of TextMate language grammars postgresql
would still need added to the syntax definition though. Close?
I wonder if it would be possible to define some kind of mechanism that lets a user define what the language of the
embeddedLanguages
should map to. I ask because there are existing VSCode tooling extensions around thepostgresql
language for example that might be able to be lit up if the text was tagged aspostgres
language instead of justsql
. Are you aware of any ways to do this?