killalau/vscode-liquid-snippets

Can we get the new section schema tags please

Closed this issue · 4 comments

I'm wondering if the new section schema tags can be added?

  • {% schema %}{% endschema %}
  • {% stylesheet %}{% endstylesheet %}
  • {% javascript %}{% endjavascript %}

Maybe also some larger code expansion on the {% schema %} tag where it expands with some default schema?

{% schema %}
{
   "name": "section",
   "settings": [],
   "blocks": [],
   "presets": [],
}
{% endschema %{

What if we have 3 sets of schema tag, schema, schema-empty and schema-locales. And also we have stylesheet and stylesheet-scss. I've a long time didn't code with liquid, not sure if this help.

// schema
{% schema %}
{
   "name": "section",
   "settings": [],
   "blocks": [],
   "presets": [],
   "default": {}
}
{% endschema %}

// schema-empty
{% schema %}
{}
{% endschema %}

// schema-locales
{
   "locales": {
      "en": {
        "title": "Welcome"
      }
   }
}

// stylesheet
{% stylesheet %}
{% endstylesheet %}

// stylesheet-scss
{% stylesheet 'scss' %}
{% endstylesheet %}

I’ve got a PR that provides simple snippets for this if anyone can merge, that would be great. Thanks.

merged with little modification.

Thanks @killalau! You're a legend.