Autoindent code in visual studio code

cgregnanin
Tourist
18 0 1

Hi, I'm using visual studio code to edit the Dawn theme.
When I try to format the code the schema section is not formatted.
What is the best way to format code in .liquid files?

Replies 7 (7)
ThomasBorowski
Shopify Expert
650 44 153

Are you using this extension?

 

https://marketplace.visualstudio.com/items?itemName=sissel.shopify-liquid

Did my solution work? Help other Community members easily find the correct solution and apply it to their own stores by marking it as the Accepted Solution and giving it a Thumbs Up
★ EU B2B customer registration with VAT ID validation: https://apps.shopify.com/b2b-customer-registration ★
cgregnanin
Tourist
18 0 1

Yes, the liquid code and the json schema are not formatted.

I use ctrl+shift+i

ThomasBorowski
Shopify Expert
650 44 153

Try Ctrl+Shift+L, that should use the Liquid formatter provided by the extension. Or via the command palette enter format.

ksnip_20211123-210039.png

Did my solution work? Help other Community members easily find the correct solution and apply it to their own stores by marking it as the Accepted Solution and giving it a Thumbs Up
★ EU B2B customer registration with VAT ID validation: https://apps.shopify.com/b2b-customer-registration ★
cgregnanin
Tourist
18 0 1

Ctrl+Shift+L Don't work.

I have generated the .liquidrc in my workspace 

 

cgregnanin_0-1637700327380.png

 

ThomasBorowski
Shopify Expert
650 44 153

Then that .liquidrc file is likely not working as intended, I don't have that file and the formatting works correctly out of the box.

Did my solution work? Help other Community members easily find the correct solution and apply it to their own stores by marking it as the Accepted Solution and giving it a Thumbs Up
★ EU B2B customer registration with VAT ID validation: https://apps.shopify.com/b2b-customer-registration ★
cgregnanin
Tourist
18 0 1
What solution can I try ?
ThomasBorowski
Shopify Expert
650 44 153

I don't really know ¯\_(ツ)_/¯

 

Maybe post an issue on the extension's GitHub repo.

Did my solution work? Help other Community members easily find the correct solution and apply it to their own stores by marking it as the Accepted Solution and giving it a Thumbs Up
★ EU B2B customer registration with VAT ID validation: https://apps.shopify.com/b2b-customer-registration ★