Code Monkey home page Code Monkey logo

Comments (5)

arasherr avatar arasherr commented on June 11, 2024 1

You're probably using prettier as your code formatter and that is causing the issue. a quick workaround is to add prettier-ignore comment before your schema.

{%- comment -%}<!-- prettier-ignore -->{%- endcomment -%}
{% schema %}
{
  ...
}
{% endschema %}

or the better alternative is to install the Liquid extension and set that as your code formatter.

from shopify-theme-lab.

sergejcodes avatar sergejcodes commented on June 11, 2024

I'm also using VS Code and don't have any problems. Most likely some formatter, like already mentioned, is causing the issue.

from shopify-theme-lab.

schellenbergk avatar schellenbergk commented on June 11, 2024

Hmmm, none of that helped. But I noticed by default when opening .liquid files the language mode detected is set to HTML not liquid, when I switched to liquid language (manually) then saving did not trigger auto format. Format only worked properly when I run Liquid: Format Document command.

Is there a way to fix language detection in VSCode for liquid files and make the format on save work with it too?

from shopify-theme-lab.

schellenbergk avatar schellenbergk commented on June 11, 2024

I was able to fix the first issue with:

{
    "files.associations": {
        "*.liquid": "liquid"
    }
}

but the format on save is still an issue.

from shopify-theme-lab.

schellenbergk avatar schellenbergk commented on June 11, 2024

Just found a fix here: panoply/vscode-liquid#32 (comment) that worked for me

from shopify-theme-lab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.