Hey,
I have a usecase where I’d like the user to be able to edit a JSON object where all strings can be Liquid templates, i.e. something like:
{
"foo": "this is liquid {{ variable }}",
"xyz": {
"abc": "so is {{ this }}"
}
}
So basically, I’d like to use @codemirror/lang-json for the editor but somehow choose the string values to be @codemirror/lang-liquid.
I can somewhat achieve this with the following code:
const baseJsonLanguage = new LanguageSupport(
jsonLanguage
);
const liquidJsonLanguage = liquid({
base: baseJsonLanguage,
});
However, this breaks quotation auto-closing and I’m a bit worried about what other things it might be breaking. Is there a cleaner way to achieve a seamless Liquid integration with json?