prettier-vscode icon indicating copy to clipboard operation
prettier-vscode copied to clipboard

Editor scrolls to bottom when format large file using prettier

Open ghost opened this issue 10 months ago • 5 comments

In vscode running the editor.action.formatDocument command in a javascript file makes the editor scroll to the last line of the file which is really annoying. It happens for large files that are 6000+ lines. It tends to happen when the content of the line the cursor is on changes due to being formatted.

I've disabled all extensions apart from prettier and it's still happening. I also set up a new vscode codespace and installed prettier and no other extensions and it happens in there. This proves it is a generic issue with prettier and is not specific to my configuration.

ghost avatar Apr 01 '24 12:04 ghost

I ran into the same problem today, I had a file of almost 3k lines

JoCat avatar Apr 22 '24 12:04 JoCat

This bug is consuming a significant amount of development time and needs to be fixed promptly. With nearly 45 million installations of the Prettier VSCode extension, many users are likely frustrated by this issue. It's crucial for the developers to address this bug to avoid losing such a large user base. The bug can have serious consequences, such as unintentionally modifying the content of the last line of a file without the user realizing it. Fixing this issue will enhance user satisfaction and maintain the integrity of the extension.

ghost avatar May 31 '24 10:05 ghost

I ran into the same problem today, I had a file of almost 2.8k lines

dnjat avatar Jun 05 '24 14:06 dnjat

Same issue here. Very annoying since I've built a habit of auto-formatting frequently. Started happening once I reached about 3000 lines (maybe 100kb file size?)

davhaa15 avatar Jun 05 '24 15:06 davhaa15

我想知道,这个问题通常会发生在大文件上吗?同时,有没有办法可以临时解决这个问题呢?

hakityc avatar Jul 03 '24 02:07 hakityc