sanity-io / vscode-sanity

Visual Studio Code extension for developing applications powered by Sanity.io
47 stars 8 forks source link

Feature Request: Formatter for GROQ #8

Open jordie23 opened 3 years ago

jordie23 commented 3 years ago

I have been spoilt with almost everything I work on in VSCode has an formatter... except GROQ. First time in a while I've had to fiddle with spaces and indents.

So I'd like to request a formatter for GROQ queries. In all honesty I'm not fussed how you end up deciding it should be formatted, just that it is. Perhaps main thing would be to know if the user is using spaces or tabs, beyond that, just let me press my formatter hotkey and have it clean up the latest mess I've made 🙃

I have no idea how hard it'd be to add so I understand if it lands in that basket, but figured I'd ask :)

jordie23 commented 3 years ago

Not sure if this is helpful to you guys but looks like there's been two attempts at this, maybe they can be added in or adapted? Or be helpful guides?

@alevroub 's one here https://github.com/alevroub/prettier-plugin-groq

and @mcky 's one here https://github.com/mcky/prettier-plugin-groq

giacomoalonzi commented 2 months ago

Not sure if this is helpful to you guys but looks like there's been two attempts at this, maybe they can be added in or adapted? Or be helpful guides?

@alevroub 's one here https://github.com/alevroub/prettier-plugin-groq

and @mcky 's one here https://github.com/mcky/prettier-plugin-groq

tried with no luck :\