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

Refactor format implementation with paramTypes #110

Closed senkenn closed 3 weeks ago

senkenn commented 3 weeks ago

paramTypes: https://github.com/sql-formatter-org/sql-formatter/blob/master/docs/paramTypes.md#paramtypes

sqlsurge will format with these steps:

  1. convert place holder to dummy if there are any place holders
  2. format
  3. reverse the place holders

implementation: https://github.com/senkenn/sqlsurge/blob/2c287808c4f4e57d1be12cc054dfed8cbdad84d1/vsce/src/commands/formatSql.ts#L85-L124

if we use paramTypes, maybe we don't need to convert&revert place holders.