Skip to content

[VSCODE] Not working with Format Selection and Format Selection With #232

Open
@inferrinizzard

Description

@inferrinizzard

<Transferred from inferrinizzard#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:

  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

  • 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-sql extension, if relevant to the issue? Not relevant

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    vscodeRelated to the VSCode Extension

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions