Releases: andrelopes-code/sql-format-and-highlight
v0.2.0 — Per-block dialect via --sql@<alias> + 5 new formatter knobs
Highlights
-
--sql@<alias>for per-block dialect override. Tag a template literal with--sql@rmand the extension resolves the dialect viasqlFormatAndHighlight.databases:Each block is formatted using its alias's dialect. Unmapped aliases fall back to the global
dialectsilently. The@aliastoken is compatible with other tools that already use--sql@dbfor routing — same marker, complementary purposes. -
Five new settings covering the rest of the
sql-formattersurface:dataTypeCase—upper/lower/preserveforINT,VARCHAR, etc. in DDL. Fixes a regression wherevarcharlowercase leaked through even withkeywordCase: upper.useTabs— tab-indented output.expressionWidth— line-wrap threshold.linesBetweenQueries— blank lines between;-separated statements.newlineBeforeSemicolon— closing;on its own line.
-
README revamped with a multi-database recipe and a stronger 'set your dialect once' opening — the generic default rejects vendor-specific syntax silently.
-
12 new T-SQL robustness tests covering bracketed identifiers,
DECLARE @var, CTE with;WITH,MERGE,TOP (N),OUTPUT INTO,@@vars,CROSS APPLY,IDENTITY_INSERT,BEGIN TRY/CATCH,EXEC sp_executesql, andOVER (PARTITION BY). Plus 7 detector tests for@<alias>extraction and 4 for the resolver.
Compatibility
Fully backwards compatible with 0.1.0. The new @<alias> syntax is opt-in; existing markers (--sql, --sql:flag, --sql:rm:verbose) keep working exactly as before.
See CHANGELOG.md for the full detail.
v0.1.0 — Native formatter + interpolation support
Highlights
- Native formatter provider.
Shift+Alt+F(Format Document) and Format Selection now work. Configure aseditor.defaultFormatterper language for clean Prettier coexistence. - Template literal interpolation preserved.
${expr}(with nested braces and quoted strings) survives formatting via sentinel substitution. - Error visibility. Parse failures surface in the SQL Format output channel instead of being swallowed.
- Consolidated TextMate grammars. A single injection into
L:string.templatereplaces the fragile two-grammar setup. - Marketplace metadata. Publisher, license, repository, keywords, icon-ready package layout.
- Lower engine requirement.
engines.vscodedropped from^1.110.0to^1.75.0.
Fixes
paramTypesruntime default now matches the schema default ([":"]).- Compiled tests no longer ship inside the .vsix.
See CHANGELOG.md for the full list.