Autoindent code in visual studio code

Topic summary

Auto-indenting/formatting Shopify Liquid files and the schema JSON in Visual Studio Code for the Dawn theme. Liquid is Shopify’s templating language; the schema section is a JSON block that defines theme settings.

  • Recommended tool: the “Shopify Liquid” VS Code extension (sissel.shopify-liquid).
  • Correct action: use the extension’s formatter via Ctrl+Shift+L or the Command Palette (search “Format Document”). Using Ctrl+Shift+I or Ctrl+Alt+F may not invoke the Liquid formatter.

One participant reports that Ctrl+Shift+L works and fixed their previous issues when using the default VS Code formatter. Another reports that neither Liquid nor schema formatting works, even with the extension and Ctrl+Shift+L.

Potential cause: a workspace .liquidrc configuration may be interfering; others note formatting works out of the box without this file.

Suggested next step: remove/disable the .liquidrc or open an issue on the extension’s GitHub repository.

Status: unresolved for the original reporter; workaround confirmed by another user. Screenshots show keybinding and .liquidrc, but are not essential to follow the thread.

Summarized with AI on February 10. AI used: gpt-5.

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?

Are you using this extension?

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

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

I use ctrl+shift+i

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

2 Likes

Ctrl+Shift+L Don’t work.

I have generated the .liquidrc in my workspace

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.

What solution can I try ?

I don’t really know ¯_(ツ)_/¯

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

Give this guy a medal! I always used ctrl+alt+f and thought the formatting was not working well and had no clue. CTRL +SHIFT + L is what I needed! Thank you!