Skip to content

Commit

Permalink
Fix test cases
Browse files Browse the repository at this point in the history
Signed-off-by: worksofliam <[email protected]>
  • Loading branch information
worksofliam committed Sep 23, 2024
1 parent 008e435 commit 6c3ee29
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/language/sql/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ export function formatSql(textDocument: string, options: FormatOptions = {}): st
currentIndent -= 4;
}

if (options.spaceBetweenStatements) {
if (prevType !== statement.type) {
result.push(``);
}
}

result.push(...formatTokens(withBlocks, options).map(l => ``.padEnd(currentIndent) + l));
if (!statement.isCompoundStart()) {
result[result.length-1] += `;`
}

if (options.spaceBetweenStatements) {
if (prevType !== statement.type && i < statementGroup.statements.length - 1) {
result.push(``);
}
}

if (statement.isCompoundStart() || statement.isConditionStart()) {
currentIndent += 4;
}
Expand Down

0 comments on commit 6c3ee29

Please sign in to comment.