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

Nothing works after updating to 3.0.0 #106

Closed Aizistral closed 2 years ago

Aizistral commented 2 years ago

Syntax highlighting with 2.3.0: image Same syntax with 3.0.2: image Same for completion options and everything else. It doesn't seem like extension does anything at all. I tried to reset configuration to default, didn't help. What could be the issue?

panoply commented 2 years ago

Hey @Aizistral you are using HTML as the language identifier. You need to change it to Liquid.

https://user-images.githubusercontent.com/7041324/193077576-0c43960e-aa71-4a44-aea4-f96b5dfdf621.mov

Aizistral commented 2 years ago

It works, but only for the specific document where I do that. Do I have to do that manually for every document in my project?

Aizistral commented 2 years ago

I just wonder, it worked without any of those shenanigans in 2.3.0. Isn't there a way to make it work the same way in an updated version?

panoply commented 2 years ago

It works, but only for the specific document where I do that. Do I have to do that manually for every document in my project?

You will need to update existing options in your workspace/user settings configuration that you have set to automatically associate *.liquid files to liquid language:

{
  "files.associations": {
       "*.liquid": "liquid"
      }
}

I just wonder, it worked without any of those shenanigans in 2.3.0. Isn't there a way to make it work the same way in an updated version?

As above. I can probably add this feature to defaults to prevent this from occurring. I will consider it if anymore issues arise for other users.

Aizistral commented 2 years ago

You will need to update existing options in your workspace/user settings configuration that you have set to automatically associate *.liquid files to liquid language

The problem is that I use Jekyll and files where I employ Liquid syntax are anything but .liquid. Changing association for those seems to work, but will it not break anything else?

panoply commented 2 years ago

So for Jekyll, that should work as intended. The new version supports:

Though keep in mind that formatting support may still be a little flakey. The defaults are setup to automatically associate to the following file extensions:

 {
   "files.associations": {
      "*.json.liquid": "json",
      "*.yaml.liquid": "yaml",
      "*.md.liquid": "markdown",
      "*.js.liquid": "liquid-javascript",
      "*.css.liquid": "liquid-css",
      "*.scss.liquid": "liquid-scss"
    }
 }

What this means is unless you have existing file associations applied, everything should work as intended. Also, because you are working with Jekyll it might be a good idea to change the engine to Standard so as to prevent Shopify completions and handling from occurring, eg:

{
    "liquid.engine": "standard"
}
Aizistral commented 2 years ago

Alright, thanks!