timdmackey / vscode-mechanic-liquid

Provides unofficial support for syntax highlighting and code snippets for the Mechanic app on the Shopify platform.
Other
4 stars 0 forks source link

Add missing tags and filters #7

Open timdmackey opened 4 months ago

timdmackey commented 4 months ago

This extension could use some love—It's been a while since the last update, and I think quite a few tags and filters have been added since then. I'm hoping to compile a list here so I can add them to the extension.

I’d also like to add support for code completion in the liquid tag, but without a complete rewrite there’s no straightforward solution.

What I’ve come up with at the moment is to use a prefix character to denote inline snippets, something that’s easy to type, and not used often elsewhere in liquid code like ` or ;. I can create multiple prefixes, so feedback on this solution would be appreciated!

In practice this would look like the following: Typing capture + TAB would generate this code:

{% capture variable %}
  ▓
{% endcapture %}

while typing `capture + TAB (with the backtick) would generate this:

capture variable
  echo "▓"
capture

which would be proper syntax inside of a liquid tag:

{% liquid
  capture variable
    echo "▓"
  capture
%}
tekhaus commented 4 months ago

the date filter was just revamped a great deal last week :)

comb through here as well, it won't include all changes though - https://mechanic.canny.io/futures?status=complete

quick check of filters

base64 filters have changed

tekhaus commented 4 months ago

From the Shopify side (but supported by Mechanic), these are missing (not sure on newness, nor giving an opinion on usefulness, although I can if desired):

tekhaus commented 4 months ago

Tags:

timdmackey commented 4 months ago

@tekhaus Thanks for the feedback! regarding the liquid tag, what do you think of the solution I've come up with? I added the details to the original post, but basically to use tag snippets inside a liquid block, I can make it so you type the snippet preceded by a special character, for example `as.. for an inline assign tag vs as.. for a "block" assign tag. This method is pretty trivial to build, it's just a question of whether it's usable.

tekhaus commented 3 months ago

@timdmackey I'm afraid I have no useful input on the liquid tag, as I have never used it,