microsoft / vscode-postgresql

PostgreSQL extension for VSCODE
Other
399 stars 50 forks source link

Formatting indents too much for JSON queries #47

Open mfulton26 opened 5 years ago

mfulton26 commented 5 years ago

Steps to Reproduce:

  1. Run "PostgreSQL: New Query"
  2. Add the following content:

    SELECT a, b, c FROM table_name;
    SELECT jsonb->>'a', jsonb->>'b', jsonb->>'c' FROM table_name;
  3. Run "Format Document"

Result:

SELECT a,
       b,
       c
FROM table_name;

SELECT jsonb->>'a',
               jsonb->>'b',
                       jsonb->>'c'
FROM table_name;

I would prefer the formatting to align selections for JSON data consistently with other selections. e.g.:

SELECT a,
       b,
       c
FROM table_name;

SELECT jsonb->>'a',
       jsonb->>'b',
       jsonb->>'c'
FROM table_name;