nene / prettier-plugin-sql-cst

Prettier SQL plugin that uses sql-parser-cst
https://nene.github.io/prettier-sql-playground/
GNU General Public License v3.0
122 stars 7 forks source link

VSCode implementation #31

Closed migueldft closed 2 weeks ago

migueldft commented 1 month ago

Hi @nene I have been using a VSCode extension of your last repo, but I was wondering if/when we are going to be able to use this current repo's formatter.

I would love as this is probably going to be used as default in my company

nene commented 1 month ago

Hi Miguel,

I don't have any plans of creating any editor extensions for this. As this is just a prettier plugin, the official Prettier extension works just fine.

as this is probably going to be used as default in my company

Wow, that's nice to hear. ❤️

migueldft commented 1 month ago

Perfect ! Will try to use it as just a plugin then.

May be a noob problem, but could you help me out on this ? i have already installed is via npm install --save-dev prettier prettier-plugin-sql-cst but VSCode Prettier is not recognizing it on my SQL files

nene commented 1 month ago

You probably should add the plugin name to your prettier configuration file: https://prettier.io/docs/en/plugins#using-plugins

nene commented 1 month ago

Depending on which SQL dialect you're working with, you probably also want to override which parser is used for .sql files: https://github.com/nene/prettier-plugin-sql-cst?tab=readme-ov-file#choosing-an-sql-dialect