sql-formatter-org / sql-formatter-org/sql-formatter
[VSCODE] Not working with Format Selection and Format Selection With
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 456
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 3
Description
<Transferred from inferrinizzard/prettier-sql#88>
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:
-
Set Prettier SQL as default formatter in VSCODE settings JSON:
"[sql]": {
"editor.defaultFormatter": "inferrinizzard.prettier-sql-vscode"
} -
Open or create an SQL document
-
Select some text on the document
-
Click mouse right button for context menu
-
Select "Format Selection"
-
See Warning/error
-
Choose "Cancel"
-
Repeat step 3 and 4
-
Select "Format Selection With..."
-
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
- What SQL language(s) does this apply to? any
- What VSCode version are you using? 1.67.2
- What are your currently configured VSCode settings for the
prettier-sqlextension, if relevant to the issue? Not relevant
Additional context
N/A
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the problem in VS Code using the shown [sql] default-formatter setting, a SQL document, and a partial selection. Investigate how the Prettier SQL VSCode extension registers formatting support for SQL selections and verify both “Format Selection” and “Format Selection With...” workflows. Done means selected SQL can be formatted and the extension appears as an available formatter.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql, typescript, vscode
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100