senkenn / sqlsurge

Visual Studio Code extension for SQL language server
https://marketplace.visualstudio.com/items?itemName=senken.sqlsurge
MIT License
18 stars 0 forks source link

Customize formatting #105

Open musjj opened 1 week ago

musjj commented 1 week ago

It would be nice if you can customize sql-formatter. For example to automatically have uppercase keywords:

.sql-formatter.json

{
  "dialect": "postgresql",
  "keywordCase": "upper",
  "dataTypeCase": "upper"
}

It seems that the config file is ignored currently.

senkenn commented 1 week ago

ok! i’ll try.

senkenn commented 3 days ago

Hmm, I also think it might be best to use the format feature of LSP. Let me be discreet, please.

senkenn commented 3 days ago

Using the LSP formatter feels more consistent with the SQL in the SQL file and the raw SQL in the other files, and feels like the right way to go.

musjj commented 4 hours ago

LSP formatters are great, but the nice thing about external formatters is that you can trigger them in a CI. Though I guess you currently can't use the formatter for embedded sql strings.