Closed muchisx closed 1 year ago
Good catch.
Maybe it is worth releasing the embedded regions capability to override this. Let's discuss more in discord.
Let's make some action here. I am contemplating moving straight toward embedded region support which would make schema snippets obsolete as the JSON Schema Stores would be used in-place. The resulting effect would be this:
https://user-images.githubusercontent.com/7041324/198382398-be65049d-058f-47f5-a861-cd4cbae1bd5f.mp4
The hurdles here is that implementing this may require moving to Liquify as the Language Server is required in order to provide the JSON Language Features. I need to investigate if this can achieved without moving directly to Server/Client logic as it would double the workload considering this already possible in Liquify.
If going ahead here, integrating completions for section.settings.*
and block.settings.*
is a no brainer. Essentially providing completions in accordance with the JSON contained in section {% schema %}
tags, for example:
{% # The "foo" completion will be made available upon typing a "." and the "info" will supply description %}
{{ section.settings.foo }}
{% schema %}
{
"name": "Foo",
"tag": "section",
"settings": [
{
"type": "text",
"id": "action",
"label": "Action",
"info": "This description will be applied to the completion"
}
]
}
{% endschema %}
The logic for this already exists but would need some testing. My main hesitation of making it available are:
The counter arguments to this are as follows:
Thoughts / ideas and use cases greatly appreciated.
This will be supported in 3.2.0 and in addition section.*
schema tag completions. The {% schema %}
tag is parsed and persisted to provide your values defined in the schema JSON structure. It uses the info property value for descriptions.
Example:
https://user-images.githubusercontent.com/7041324/206410605-d322411d-bdd0-46d7-bd07-ac5331dccd5d.mov
Shipping tomorrow 🚢
Hi!
Currently Schema snippets are not working because their scope is liquid:
But the Schema liquid tag contains Json content, not liquid
As a result, snippets show up above/after the schema tag but not inside of it, it should be the opposite !