Shopify Editions Summer 22': Code Editor Formatting

Hi everyone,

Just had a quick question regarding the code editor in the most recent Summer '22 update. I’ve noticed things look a little different, and there appears to be some nice QoL changes like tag auto-completion (love it). However, it seems that the ability to auto-format the code is gone.

Has this changed and if so, is there a way to re-enable it? On the old editor, highlighting all the code and hitting “Shift-Tab” would format the document. In the new editor, it simply reduces indentation. I have yet to find any way to really reliably format my Liquid code. Maybe someone could point me in the right direction?

Any input is much appreciated.

I haven’t checked but try bracket indention i.e. ctrl+[ = indent less and ctrl+] = indent more

Avoid cross posting, but know there is a dedicated forum right now for Shopify Editions

https://community.shopify.com/c/shopify-editions/bd-p/editions

TQ&A has a bit more visibility, but you could request your post (by self reporting it inappropriate in the menu) be moved to the editions-board if you want the question in that forum.

Is this a crosspost if there is no relevant post like mine in the “Editions” forum? I did not realize that there was a dedicated forum for this particular update. Either way, my mistake. I do appreciate your response, however, that just explains how to move the indentation. I was asking if the feature to format the code in the editor would return. It just so happens that the shortcut for that was also similar to many others that reduce indentation (Shift + Tab).

I am honestly not too worried about this issue at the moment. Thankfully only one of my sites seems to have some of the newer features so all I can do is just hope that by the time it rolls out to my other stores, Shopify will have some of these quality of life changes added back in. Another shortcut that either wasn’t added, or was removed, is hitting Control + S to save the changes. New editor doesn’t recognize it and just tries to save the web document. It’s just hard to beat muscle memory. Fingers crossed.

No apology need not a mistake. I just don’t know if that’s cross posting kinda why I phrased it like a warning since it’s duplicate content. I personally wouldn’t mind seeing it both as editions needs the traffic prolly lol.

For auto-format of entire document, try question mark(shift+/ = ?) to see if the editor team got clever, normally that pull up only the admin shortcuts in other areas of the admin.

reminder If trying random keys in the browser avoid ctrl+w or ctrl+shift+w as that will close tabs or entire thing.

I think under the hood it was the code-mirror library being used but that has no formatting command/keybind to fallback on so the one you were using was custom to shopify afaik.

If they’ve switched to a vscode system or moving to using vscode formatting shortcuts then on Windows try Shift + Alt + F. or ctrl+shift+f.

There is now the prettier-plugin https://www.shopify.com/editions/summer2022/dev#prettier-plugin that leads to :

From

https://github.com/Shopify/prettier-plugin-liquid/wiki/Use-it-in-your-editor#:~:text=%3A%20true%0A%20%20%7D%2C%0A%7D-,From%20any%20Liquid%20file%2C%20you%20can%20Format%20Document,-%3A & https://github.com/shopify/prettier-plugin-liquid#----------shopify-liquid-prettier-plugin–

If NONE of that works consider adding to the prettier plugin discussion to see if this will be used with the admin editor and how: https://github.com/Shopify/prettier-plugin-liquid/discussions

Or if you don’t want a github account for some reason I can do it just let me know (by @ mention to get through the noise)

Oof, i use a local editor mainly but when I need to use the admins editor that will be a royal pain.

Thanks so much for your response and all the detailed information. This answers or at least provides insight to more than I could have asked for. I unfortunately had no luck with those shortcuts nor was I able to pop open the “admin shortcuts”. The “prettier” plugin you linked looks fantastic so I will be giving it a go. I’ll also keep in mind the GitHub discussions in case I run into any issues moving forward.

I think I will need to switch my workflow up as I begin working on more and more themes. I believe being able to make my changes in my editor and push them up to GitHub, then back down to Shopify, would be a great improvement for me. This probably isn’t the exact workflow but I’m aware there is an alternative way to do things without using admin.

Seriously, thanks so much for your time and help here. I’m fairly new to Shopify and am still learning the best way to do certain things.