vscode-sqltools icon indicating copy to clipboard operation
vscode-sqltools copied to clipboard

Newlines before comments are sometimes removed

Open pangolingo opened this issue 9 months ago • 0 comments

Describe the bug When formatting a Postgres SQL statement with a comment on its own line, the comment is placed at the end of the preceding line.

To Reproduce Paste this SQL statement into the online formatter playground at https://vscode-sqltools.mteixeira.dev/en/playground/formatter?umd_source=repository&utm_medium=readme&utm_campaign=formatter

SELECT * FROM my_table
-- test comment
WHERE x = 1;

Observe the result:

SELECT * FROM my_table -- test comment
WHERE x = 1;

Expected behavior The comment is kept on it's own line

Screenshots

Screen Shot 2024-05-22 at 12 26 53 PM

pangolingo avatar May 22 '24 17:05 pangolingo