panoply / vscode-liquid

💧Liquid language support for VS Code
https://marketplace.visualstudio.com/items?itemName=sissel.shopify-liquid
Other
171 stars 22 forks source link

Syntax highlighting in json files #109

Open benjaminbosko opened 1 year ago

benjaminbosko commented 1 year ago

In case of quoted strings the syntax highlighting is not working in json files. image

Originally posted by @benjaminbosko in https://github.com/panoply/vscode-liquid/issues/84#issuecomment-1261801394

panoply commented 1 year ago

Hey @benjaminbosko

I have not forgotten about this but am a little hesitant on making it available anytime soon. The reason for this is because Yaml and JSON files apply Liquid syntax support using injection grammars. This might be a little problematic for folks who have installed the extension but are not always working with Liquid.

Take the following code sample:

{
  "property": "{%"
}

The above sample will invalidate scopes proceeding the unclosed Liquid delimiter. This is actually the case with Yaml presently and though I shipped it in v3.0.0 it is indeed problematic. I need to look into improving this aspect and potentially re-thinking how I currently employ the grammar scopes as I'd preferably like to avoid edge cases of this nature no matter how rare.

I'll keep this open and investigate this more. It is not impossible, I just need to work out the best way to implement it.

benjaminbosko commented 1 year ago

Sure. Thank you in advance!