Closed jota0222 closed 2 weeks ago
This issue has been labeled as stale due to inactivity. Reply to keep this issue open.
I have noticed it happens mostly in JSX files.
In JS files it works but I must select a complete section, but that's probably a different issue.
Yeah I get this issue a lot with the jsx files. It will only format the whole document even after selecting the "Format Selection"
The same problem when formatting Python files. I'm wondering if this gets ever fixed. This dates back to year 2017 (#134)?
Edit: This has just got hopefully fixed in microsoft/vscode-black-formatter#374 and will be released soon. Until then, one just gets some by-default invisible (!) warning in the OUTPUT console:
2023-12-20 20:41:16.184 [info] [Warn - 8:41:16 PM] Black does not support range formatting. Formatting entire document.
It doesn't shows Prettier
option, in Format Selection With...
. I just want to format the class attributes in HTML file. The class attributes have Tailwind CSS. I don't want to format the HTML file but the class attributes.
This issue has been labeled as stale due to inactivity. Reply to keep this issue open.
Summary
Prettier is formatting the whole document when executing format selection, at least in linux.
Github Repository to Reproduce Issue
Link to a Github repo that can be used to reproduce the issue.
Steps To Reproduce:
Expected result
Only the selected part should be formatted
Actual result
It formatts everything in the document.
Additional information
https://github.com/prettier/prettier-vscode/assets/12126375/5d31a577-e7af-4608-811e-1a2dd00c2366
VS Code Version:
Version: 1.82.1 Commit: 6509174151d557a81c9d0b5f8a5a1e9274db5585 Date: 2023-09-08T08:41:36.199Z Electron: 25.8.0 ElectronBuildId: 23503258 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Linux x64 5.18.17-amd64-desktop-hwe
Prettier Extension Version: v10.1.0
OS and version: Linux Deepin 20.9 (based on Debian 10)
Prettier Log Output