Open Anthony-Fiddes opened 11 months ago
Thanks for reporting.
Comments being moved slightly is one thing, but getting multiple line-comments on a single line and their order changed is a much more serious issue. Like currently this SQL:
CREATE TABLE foo -- comment1
-- comment2
(
bar INT
);
gets formatted as:
CREATE TABLE foo -- comment2 -- comment1
(
bar INT
);
I don't really know why this happens, because I've left the handling of comments to the Prettier engine. Two line-comments one-after-another seems like a bug in Prettier itself. Though possibly my input of comments data might be incorrect for Prettier.
One hope is that perhaps this works better in Prettier 3.x. Should first upgrade to latest Prettier and then investigate further.
Tried upgrading to Prettier 3. Bunch of problems there... but I did find out that it won't fix this comments formatting issue.
I'm experiencing a curious bug where comments don't end up where I expect. In addition, if I keep formatting the text, the comments keep moving until they all settle on the same line.
Language: BigQuery
Text to format:
Expected output:
Actual output: