-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug Report: Formatting moves comments unexpectedly #9
Comments
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. |
Related to prettier/prettier#15978 |
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:
The text was updated successfully, but these errors were encountered: