vscode-liquid icon indicating copy to clipboard operation
vscode-liquid copied to clipboard

Any liquid.setting is seen as an error

Open jordihoven opened this issue 4 years ago • 6 comments

I have some Liquid tags in my

<style> #bar-container { position: relative; top: 65px; z-index: 5; width: 100%; background-color: {{ section.settings.announcement_bg }} ; /* Having the BG color available in the customizer */ height: 40px; display: flex; align-items: center; font-size: 14px; } </style>

The {{ section.settings.announcement_bg }} gives the error: "property value expected".

Any way of ignoring these errors?

jordihoven avatar Jan 04 '21 15:01 jordihoven

Hey @Jordakoes,

This is being caused because vscode is validating the <style> tag and does not understand Liquid, you can disable validation on scripts and styles if you are infusing Liquid with those languages, add these settings to your vscode workspace settings file:

{
  "html.validate.scripts": false,
  "html.validate.styles": false
}

panoply avatar Jan 04 '21 15:01 panoply

Hi,

Will this not cause all scripts and styles to be ignored, eg not checked? I don’t want my code editor to ignore all errors, just the ones where I infuse Liquid in Style, HTML or Script tags.

Cheers, Jordi

On 4 Jan 2021, at 16:55, cаввидис [email protected] wrote:

Hey @Jordakoes https://github.com/Jordakoes,

This is being caused because vscode is validating the

{ "html.validate.scripts": false, "html.validate.styles": false } — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/panoply/vscode-liquid/issues/65#issuecomment-754056746, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIMZ2YO3FTYHREGJZIJ3I23SYHQIDANCNFSM4VTFBQWQ.

jordihoven avatar Jan 06 '21 13:01 jordihoven

I'm getting the same issue with script and style tags in theme.liquid. Declaration or statement expected

aronweston avatar Feb 01 '21 20:02 aronweston

Hey @Jordakoes,

This is being caused because vscode is validating the <style> tag and does not understand Liquid, you can disable validation on scripts and styles if you are infusing Liquid with those languages, add these settings to your vscode workspace settings file:

{
  "html.validate.scripts": false,
  "html.validate.styles": false
}

and on a .liquid file ? 🧐

haroldao avatar May 14 '21 03:05 haroldao

Odd cause I swear I used to not have this problem with this extension a year or so ago? Am I trippin'?

james0r avatar Aug 07 '21 06:08 james0r

@james0r If you are tripping, so am I. :)

Anyway - the workaround described by @haroldao worked for me as well. :)

kjlibsol avatar Nov 10 '21 15:11 kjlibsol

🚢 Shipped v3.0.0

panoply avatar Sep 28 '22 08:09 panoply