Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code Format Selection is formatting the entire document. Why?

I am simply trying to format only the selected text in my Vue project. I have prettier installed and can format the entire document just fine.

I need to format only the selected text which works on my home computer but not my work laptop. I can even right-click the selected text, and see the option Format Selection. If I click it, it formats the entire document.

Image

What is going on? Please help.

like image 246
mcool Avatar asked May 25 '26 23:05

mcool


1 Answers

I have the same problem as you and the issues seems to be that with prettier-eslint not supporting range formatting.

See more here: https://github.com/prettier/prettier-vscode/issues/137

like image 80
Jammar Avatar answered May 30 '26 12:05

Jammar