SQL variables with {{ var_name }}

I’m new to Codemirror 6 and wanted to know what’s the best way to customize the SQL lang to support variables that are enclosed with double brackets {{ var }}. I would like to be able style/highlight those variables and also add a tooltip on hover. Would I need to make a customization of the SQL grammar and create a custom language, or is there a simpler way to achieve this with the existing SQL lang extension?

Here’s an example of what the brackets looked like in a customization of v5.

The parser in @codemirror/lang-sql doesn’t support this syntax, so you’ll have to build your own parser for it.

Hi, could you please share your code? I also need to highlight and show a tooltip.