Open JordanAnthonyKing opened 2 weeks ago
From our docs:
M-x prettier-prettify-region to prettify region (but note that region should align with a complete block of code).
This is somewhat misleading, we should update the docs to read "a complete top-level block of code".
That's because we're sending only the selected block to Prettier and so it thinks it's formatting a top-level construct, which yours isn't.
Admittedly that's not very useful. Perhaps it would be better to send the whole buffer up to the end of the region, have Prettier format that, then throw away any changes outside the region. I might implement that in the successor to this project which I'm working on, on and off.
Whoops, reopening as a reminder to update the docs.
I get errors when I simply try to prettify a highlighted region. Prettifying the enter buffer works without issue: