-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prettier formatting causes document to jump with insiders #71707
Comments
(Experimental duplicate detection) |
Are you really sure that in 1.32 prettier was used for formatting? Before 1.33 it wasn't well defined which formatter was used and I am asking because we changed a lot how we pick formatters but not how the actual formatting edits are applied. |
Yeah, it was using prettier extension formatter. And it was fine for most of the insiders of 1.33 until the last week or so. And to be clear the formatting is working just fine, it's just that after the format (on save) the editor is scrolled down a page or 2 below where the cursor was and the cursor gets placed at the end of the file. |
And this changed with format-on-save only or all formatting? |
I can confirm this bug too, it occurs only when For I'm pretty sure that this bug is a regression, it's been here several months ago and was fixed. |
I fully second @eamodio and @martinschayna on this issue. I have exactly the same problem since my upgrade to The pattern described by @martinschayna is accurate. |
Indeed an unfortunate regression. Before, we would attempt to apply the formatting edits using the editor (when available during save) and now we always use the model (which is not as good as using the editor itself). |
I noticed the same bug since updating to the newest VSCode version two days ago. |
This regression is not limited to the Prettier extension, it also impacts language servers that implement I'm wondering if it would be possible to update the |
Happens only when file size is > 10000 bytes. To reproduce: get a file with 10000 bytes. Yet another test: get a file with 10000+ chars |
This is fixed (for next insiders) and will also be part of 1.33.1 |
Hello @jrieken, Thanks for the quick fix. When it will merge into a stable release? or how often stable release occurs? |
microsoft/vscode-go#2426 (comment) Some reformatting issues still happening after 1.34.0-insider vscode-go extension: 0.9.2 After ctrl+s, cursor doesn't jump to bottom of file anymore (like it did in 1.33) Screen record: https://i.imgur.com/nV7urMG.gif This might be issue with vscode instead of vscode-go, as result changes while updating vscode, but keeping same extension version. |
Issue Type: Bug
This started very recently and is not reproducible with the same setup on 1.32. Often when I am editing a decent size (~1000 lines) js/ts/tsx file and I save the file and the prettier extension kicks in and re-formats the document jumps down by a page or 2 and the cursor ends up at the very end of the file. It only seems to happen with larger files, and is reproducible every time I add a bunch of blank lines and then save.
While this might be an issue with the prettier extension itself, it doesn't happen in 1.32 and I know there was work done to code formatting this iteration.
VS Code version: Code - Insiders 1.33.0-insider (4d1cb56, 2019-04-03T08:14:19.284Z)
OS version: Windows_NT x64 10.0.18362
System Info
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
The text was updated successfully, but these errors were encountered: