Closed adrianocr closed 6 years ago
@chrisberthe introduce whitespace control ({%- tag -%}
) to us in this PR https://github.com/killalau/vscode-liquid-snippets/pull/5
Do you have any concern?
Most of the common logic tag has whitespace control now.
if
else
elsif
ifelse
unless
case
when
cycle
cyclegroup
for
continue
tablerow
assign
capture
I am stuck using an old version of liquid code, hence this update makes this plugin useless to me. Could we possibly add the whitespace control as a config setting that can be toggled?
I need to have a check on it, maybe I'll separate 2 set of snippet.
Sorry @condad, I wasn't aware that this had been added with later versions of Liquid.
I'm not familiar with building VS Code extensions but I'd be leaning towards the config setting route as well; having no whitespace by default and being able to pass something like this in your config file would be cool:
"liquid.snippets.whitespace": true
@killalau if you're unfamiliar with doing this in extensions I can try and take a look into it.
@killalau @chrisberthe there's also the case for when you simply don't need whitespace control. I've been working on Shopify themes for like 2 years now and I think in that entire time I've needed to deal with whitespace once or twice. Maybe add in some kind of trigger like if-
to get {%- if -%}
, for-
to get {%- for -%}
, etc. That would allow us to specify which output we need, regular or whitespaced.
@killalau @chrisberthe as a matter of fact I just submitted a pull request for the above.
So now if the plugin expands anything like an if or a for tag it uses the
{%- -%}
syntax instead of the regular{% %}
syntax.Screenshot: https://cl.ly/nbs2