Skip to content
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

SQL statement detection incorrect while contain blank lines #112

Closed
acn-leoli opened this issue Apr 8, 2024 · 2 comments
Closed

SQL statement detection incorrect while contain blank lines #112

acn-leoli opened this issue Apr 8, 2024 · 2 comments

Comments

@acn-leoli
Copy link

Description of the Issue

SQL statement detection incorrect while the SQL statement contains blank lines.

Steps to Reproduce the Issue

For example, below screenshot, the SQL contains blank lines between line number 6-9.

While the cursor in any line between line number 7-9, the "Run" button will be disabled, and the "Outline" panel shows nothing.

While the cursor in any line between line number 1-5 or line number 10, the "Run" button can be clicked but will have SQL syntax error as show in below screenshot, also, the SQL in the "Outline" panel missing the "as temp" part.

image

Expected Behavior

The blank lines should not impact the SQL statement detection, like how other SQL IDE tools do (eg. SQL Developer, MySQL Workbench, etc.)

Workaround

The current workaround can be either removing all the blank lines, or manually selecting the whole SQL before execution, which quite inefficient.

@Wisser
Copy link
Owner

Wisser commented Apr 9, 2024

Hello,

the behavior described here is not an error, but the intended behavior. Even if it differs from that of some other tools, it has the advantage that a semicolon is not required after every statement.
It is important that the statement indicator on the left-hand side shows the statement boundaries correctly.
In addition to the manually removing blank lines method described by you, you can also format a statement. This also removes blank lines.

image

image

@acn-leoli
Copy link
Author

Thank you for the explanation and introducing the Format SQL function.

I still wish to have a setting/configuration that can change this behaviour to align to other tools' behaviour, because in my experience, while the SQL is very complicated or over 100+ rows, some blank lines between different section of logic can make the SQL more readable.

Btw, the tool is still great and thanks for your development!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants