-
Notifications
You must be signed in to change notification settings - Fork 391
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
[FORMATTING] comments after final WITH statement #660
Comments
Thanks for reporting. Ignoring all the irrelevant SQL code, this issue comes down to: select col
-- comment
from tbl; getting formatted as: select
col
-- comment
from
tbl; instead of: select
col
-- comment
from
tbl; This is indeed unfortunate. It happens because the formatter really only looks at the tokens that preceded the comment, it's not really aware of the code that's following. Implementing this sort of lookahead is possible... but it's a major undertaking. Unlikely to happen. Instead I'm concentrating on implementing an entirely new SQL formatting tool, which should solve most of the shortcomings of the SQL Formatter. Regarding the indentation of |
Hi @nene / Rene, Thanks for answering. Nice you're working on a new version. Unfortunate that a lookahead is difficult. Few questions:
I guess these are still to come :-)
|
There are a few options. Like the option to uppercase keywords. (Not accessible from the demo page though). But the goal with this tool is to have a bare minimum of formatting options. Following more in the footsteps of the Prettier formatting tool.
Yep, that's still in the works, because I first need to implement a parser for PostgreSQL.
Sorry about that. I already dropped this feature in The AS-keyword can be used just fine. Only the feature that indents AS keywords ("Align aliases" checkbox in your screenshot) has been removed. |
Input data
Which SQL and options did you provide as input?
Expected Output
I expected the comment in line 22 to be aligned with the select afte the comment
NB. Not sure if this will start to cause other problems if you manage to fix this
PS. the
as
statements (aliases) in line 23 & line 26 are also not alignedActual Output
Usage
What SQL language(s) does this apply to?
At least PostgreSQL
Which SQL Formatter version are you using?
Online version
The text was updated successfully, but these errors were encountered: