zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
39.68k stars 2.07k forks source link

Format SQL with Prettier #9537

Open nryberg opened 3 months ago

nryberg commented 3 months ago

Check for existing issues

Describe the feature

While some languages already have automatic code formatting built in, I'd like to use Prettier to help format SQL files.

https://prettier.io/docs/en/editors.html

Super happy to see SQL syntax highlighting as a plugin - would like to take it to the next level with SQL formatting.

If applicable, add mockups / screenshots to help present your vision of the feature

Have: sql_format_have

Want: sql_format_want

SomeoneToIgnore commented 3 months ago

Zed does not have any support for SQL in it, and the only current extension (from https://github.com/zed-industries/extensions/tree/main/extensions) that supports it, does not have the required prettier metadata: https://github.com/evrsen/zed-sql/blob/8f05732666dc29577933d5ad0b72ce5a6d6840ea/languages/sql/config.toml

It seems that the SQL maintainer has to update the config to have something similar to https://github.com/zed-industries/zed/blob/main/extensions/svelte/languages/svelte/config.toml#L17-L18 and release the new version.