David
David

Reputation: 16746

How to use formatSelection on .vue files using Prettier in VS Code?

I'm trying to use the editor.action.formatSelection command on .vue files in VS Code. However, the option is not available.

I'm aware that Vetur doesn't support this feature, therefore, i've disabled Vetur's formatting so it uses prettier instead, thinking this would resolve the support issue:

[vue]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },

"vetur.format.enable": false,

However, I still don't have the option for "Format Selection" when creating a selection. I've even tried disabling Vetur entirely and I still don't have the "Format Selection" option.

I can confirm that Format Selection works on other file types. Format Document also works on .vue files.

Upvotes: 1

Views: 252

Answers (0)

Related Questions