panoply / vscode-liquid

💧Liquid language support for VS Code
https://marketplace.visualstudio.com/items?itemName=sissel.shopify-liquid
Other
171 stars 23 forks source link

You need to write a letter before writing settings #183

Open MaksymKurniy opened 6 months ago

MaksymKurniy commented 6 months ago

In the schema, when I try to add a checkbox, I need to write some letter first and then my request, if I immediately write a checkbox, I will get the following result: image but if I write like this, it will find everything, but the first letter will remain "ccheckbox" image it would also be very cool if a translation line was added to the label, something like this: "t:sections.collage.blocks.collection.settings.test.label"

panoply commented 6 months ago

Hey @MaksymKurniy

You can have completions within schema regions show up without typing by triggering the completions list using the following key mapping:

Ctrl + Space

Here is an attached video of that in action:

https://github.com/panoply/vscode-liquid/assets/7041324/17a1485f-e94b-47b1-933c-b268c7086184

In regards to the translation schema references, IIRC I have that either built in already or have it planned but its been a few months since I looked at this project. If I haven't already built in support, I can prob do that at some point. Whatever the case may be, ensure you have linked your file paths.

{
  "engine": "shopify",
  "files": {
    "locales": "locales/en.default.json" // ensure your path is passed here
   }
 }

As aforementioned, I cannot guarantee its supported yet, maybe I only built support in for .schema.json translation for | t filters.

panoply commented 6 months ago

Oh.. Wait. Now I see what you mean, you want the completions to apply when you type raw into the JSON schema regions and upon hitting enter/return, the previous entered keys (in this case c) remove and the snippet invokes.

I can support that, I'll make a note to add it in the next time I work on project.

MaksymKurniy commented 6 months ago

If I want to call a checkbox snippet, I need to write some letter and after it start writing che... so that a checkbox is offered to me. If I immediately start writing che... without a letter at the beginning, the first letter will be ignored and the sentences will start with the letters HE. and if you write CCHE or QCHE and select the checkbox, the first letter will remain. example

MaksymKurniy commented 6 months ago

| t works fine. I mean, when a snippet is added, for example the same checkbox, it is possible to immediately write its id and label. it would be cool if a line was added to the label depending on where the snippet is already located. example:

{
  "name": "t:sections.image.name",
  "settings": [
     {
      "type": "checkbox",
      "id": "|",
      "label": "t:sections.image.settings.|.label"
     }
  ]
}

and if i type test i get

{
  "name": "t:sections.image.name",
  "settings": [
     {
      "type": "checkbox",
      "id": "test",
      "label": "t:sections.image.settings.test.label"
     }
  ]
}