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

format.linesBetweenQueries "preserve" is not working? #740

Open
5 tasks
abcfy2 opened this issue Dec 11, 2020 · 2 comments
Open
5 tasks

format.linesBetweenQueries "preserve" is not working? #740

abcfy2 opened this issue Dec 11, 2020 · 2 comments

Comments

@abcfy2
Copy link

abcfy2 commented Dec 11, 2020

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. edit a sql
  2. format sql
  3. "preserve" is not working, and linesBetweenQueries seems not correct.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots

ezgif-2-cd3033ced553.zip

From the video:

  • "format.linesBetweenQueries": "preserve" --> No lines
  • "format.linesBetweenQueries": 1 --> No lines
  • "format.linesBetweenQueries": 2 --> 1 line
  • "format.linesBetweenQueries": 3 --> 2 lines

Desktop (please complete the following information):

  • SQLTools Version [e.g. v0.17.x] 0.23.0
  • VSCode Version: [e.g 1.x.y] 1.51.1
  • OS: [e.g. Windows, Linux, Mac] Linux
  • Driver:
    • PostgreSQL/Redshift
    • MySQL/MariaDB
    • MSSQL/Azure
    • SQLite
    • Other? Which...
  • Database version: [e.g. MySQL v5.6, PostgreSQL vX...]
@abcfy2 abcfy2 added the triage label Dec 11, 2020
@luni3359
Copy link

luni3359 commented May 8, 2022

Same issue here

  • SQLTools Version: 0.23.0
  • VSCode Version: 1.67.0
  • OS: Linux

@ladariha
Copy link

ladariha commented Sep 6, 2023

just a bystander note: Regarding the "linesBetweenQueries seems not correct" (e.g. 2 becomes 1 etc.), that is misunderstanding of the property. It is not number of empty lines between queries, but number of line breaks. Thus 1 line break means each query is on separate lines without any empty lines between them. 2 means 2 line breaks, meaning 1 empty line between queries and so on.

The config name is confusing here :) I actually stumbled on this when looking at similar problem in (I guess) original library https://github.com/sql-formatter-org/sql-formatter which this repo forked :)

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

No branches or pull requests

4 participants