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

Formatting comments and non-latin aliases #99

Closed
2 of 8 tasks
qoolek opened this issue Sep 18, 2018 · 3 comments
Closed
2 of 8 tasks

Formatting comments and non-latin aliases #99

qoolek opened this issue Sep 18, 2018 · 3 comments

Comments

@qoolek
Copy link

qoolek commented Sep 18, 2018

Issue Type

  • Bug
  • Enhancement
  • Feature Request
  • Question
  • Other

Prerequisites (For bugfixes)

  • Are you running the latest version?
  • Did you check the logs?
  • Did you check the Setup?

Description

I've got two problem with formatting comments and non-latin aliases

  1. After formatting, for each cyrillic simbol in alias, space is added
  2. If comment starts with SQL statements, then '--' is replaced by two minuses
select t.column1 Кириллица_cyrilic_alias
    , t.column2 Latin_alias
from db_table t
where a >= some_date1  -- from
  and a <  some_date2  -- to 
  and b >= some_date3  -- and 
  and b <  some_date4  -- where, select etc.
  and 1 = 1

Steps to Reproduce (For bugfixes)

  1. Create a .sql file with file content type set as SQL
  2. Put those simple queries into the file
  3. Apply format document command

Expected behavior: [What you expected to happen]

select
    t.column1 Кириллица_cirilic_alias,
    t.column2 Latin_alias
from
    db_table t
where
    a >= some_date1 -- from
    and a < some_date2 -- to
    and b >= some_date3 -- and
    and b < some_date4 -- where, select etc.
    and 1 = 1

Actual behavior: [What actually happened]

select
    t.column1 К и р и л л и ц а _cirilic_alias,
    t.column2 Latin_alias
from
    db_table t
where
    a >= some_date1 - -
from
    and a < some_date2 - - to
    and b >= some_date3 - -
    and
    and b < some_date4 - -
where,
select
    etc.
    and 1 = 1

Versions

  • Version: v0.15.0 (vscode 1.26.1)
  • OS: Win10
  • SGDB: MySQL
@mtxr
Copy link
Owner

mtxr commented Sep 23, 2018

It's an SQL Formatter bug. I've referenced this issue there. Let's bump it to see if they can prioritize this 😉

Related #97

@mtxr
Copy link
Owner

mtxr commented Feb 4, 2019

This is very annoying.

I'll code it there. Can't wait them anymore.

@mtxr mtxr closed this as completed in 55119f2 Feb 4, 2019
@mtxr
Copy link
Owner

mtxr commented Feb 4, 2019

I've made literally a workaround in the extension.

Let's wait for them now.

Releasing now v0.16.7

mtxr added a commit that referenced this issue Apr 7, 2019
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

2 participants