I use the Liquid Language Support plugin by Neil Ding:
https://marketplace.visualstudio.com/items?itemName=neilding.language-liquid
I also use Shopify Liquid Template Snippets by Franky Lau. This does have a dependency on the Liquid Language Support plugin that I mentioned above:
https://marketplace.visualstudio.com/items?itemName=killalau.vscode-liquid-snippets
To make it all work, follow the detailed instructions by each extension. Here are the custom settings I had have in place (sorry if I am repeating anything from their setup instructions).
- Go to User Settings
- Go to Extensions->Emmet, and select ant of the Edit in settings.json options (they all go to the same place).
- Manually add the following code to the existing JSON settings, being careful not to overwrite existing code and paying attention to adding commas where necessary:
... other json code ...
"emmet.includeLanguages": {
"liquid": "html" },
"emmet.excludeLanguages": [
"markdown"
],
"emmet.extensionsPath": "",
"files.associations": {
"*.html": "liquid",
"*.markdown": "liquid"
}
... other json code ...
Completely quit/exit Visual Studio Code before you open VSC and try it out.
In the files.assocations area, you can also add .htm
and .md
.
I did all this a while ago and believed this to be correct, so my apologies if there is anything in error. Using these extensions and the JSON file extensions, you should be able to add Shopify/Liquid commands to any html or markdown file without first having to inform VSC you want to use the language.
You mention that you see errors with JS+Liquid. I am not using any of that in my code (it is a purely static site). What I would try is adding another extension to the files.extensions
area. I have not tested this, but I recommend you set it up like the following example and give it a try:
"files.associations": {
"*.html": "liquid",
"*.markdown": "liquid",
"*.js": "liquid"
}
For the linting errors, again, I have not tried it, but give this a shot:
"emmet.includeLanguages": {
"liquid": "HTML",
"liquid": javascript"
},
Again, after you make any settings changes, quit/exit VSC and then come back in to make sure your changes are in place.
I hope this helps!