panoply / vscode-liquid

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

import asset breaking JS syntax hightlighting #140

Closed davidwarrington closed 1 year ago

davidwarrington commented 1 year ago

I'm having to write an inline script and the import syntax combined with a Liquid tag has broken highlighting

It seems full imports specifically that are causing an issue for me

import {{ 'file.js' | asset_url | json }}

image

Replacing the json filter by wrapping the liquid tag in quotes resolved the issue for me, I just prefer to use json if possible because I expect that it's safer (although now I think about it I'm unsure if it is in this context).

image

It's probably not a high priority issue regardless but figured I best report it

panoply commented 1 year ago

Good catch. Will have it fixed for #138 - Some works needs to be done on the injection grammars for embedded regions. This is a good opportunity to refine that.

panoply commented 1 year ago

@davidwarrington https://github.com/panoply/vscode-liquid/commit/65cbb2859e0ce3de3960b63093c490ff71499e66 will fix this. I definitely need more samples of Liquid being is being infused within embedded languages. This was a really great use case scenario.