inferrinizzard / prettier-sql

[ARCHIVED] Please use https://github.com/sql-formatter-org/sql-formatter
https://github.com/sql-formatter-org/sql-formatter
MIT License
21 stars 5 forks source link

[VSCODE] Not working with Format Selection and Format Selection With... #88

Open prnsantos opened 2 years ago

prnsantos commented 2 years ago

Describe the bug

It doesn't work with partial text selection to format.

When using "Format Selection" and prettier-sql is your default formatter for sql I get the following warning/error: "Visual Studio Code Configure Default Formatter Extension 'Prettier SQL VSCode' is configured as formatter but it cannot format 'SQL'-files [Configure...] [Cancel]"

When using "Format Selection With..." The option to use "prettier-sql" don't show up in VSCode dialog to choose a formatter

To Reproduce Steps to reproduce the behavior:

  1. Set Prettier SQL as default formatter in VSCODE settings JSON: "[sql]": { "editor.defaultFormatter": "inferrinizzard.prettier-sql-vscode" }

  2. Open or create an SQL document

  3. Select some text on the document

  4. Click mouse right button for context menu

  5. Select "Format Selection"

  6. See Warning/error

  7. Choose "Cancel"

  8. Repeat step 3 and 4

  9. Select "Format Selection With..."

  10. check that "prettier-sql" don't show up in VSCODE dialog

Expected behavior prettier-sql should be able to format selected text on the sql documet

Screenshots N/A

Usage

Additional context N/A