microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.09k stars 29.26k forks source link

Preserve undo history or don't hot exit when reloading immediately #200868

Closed jpaugh closed 10 months ago

jpaugh commented 10 months ago

Type: Bug

UX: Suprising behavior

Expected behavior

When I uninstall an extension and click "Reload required," I expect VSCode to either keep my undo history along with my unsaved changes, or prompt me to save all open files. (I currently use Hot Exit, and generally like that feature.)

In short: Because there's a button for reloading automatically and immediately, I have higher expectations that the IDE to get everything right for me, and that I won't miss any important state without warning.

Actual behavior

When I press "Reload required," VSCode will reload without prompting me. My unsaved file changes are still available in the editor, but the undo history is gone. The undo history is important, because the version of the file I want to keep may not be in the unsaved changes or on-disk, especially when I'm testing out new formatting plugins. (Granted, the impact is low in this example.)

Repro steps

  1. Open a document, and make changes without saving
  2. Uninstall an extension
  3. Observe that the "Uninstall" button is removed, and a "Reload required" button appears
  4. Press "Reload Required"
  5. VSCode will reload without saving the open document, and will lose undo history

Other cases

When I close VSCode and manually re-open it later, I'm less concerned about undo history. Generally, I'm pleasantly surprised when VSCode opens after a "hot exit" with work-in-progress sitting there already, and I'm already mentally prepared for a fresh start. When restarting immediately, the lack of undo information is surprising and readily apparent.

VS Code version: Code 1.85.1 (0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2, 2023-12-13T09:47:11.635Z) OS version: Linux x64 5.15.0-76-generic Modes:

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 5 3600XT 6-Core Processor (12 x 2200)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|1, 1, 1| |Memory (System)|15.54GB (2.76GB free)| |Process Argv|--unity-launch| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|ubuntu| |XDG_CURRENT_DESKTOP|Unity| |XDG_SESSION_DESKTOP|ubuntu| |XDG_SESSION_TYPE|x11|
Extensions (11) Extension|Author (truncated)|Version ---|---|--- vscode-tailwindcss|bra|0.10.3 vscode-azureresourcegroups|ms-|0.8.2 vscode-azurestaticwebapps|ms-|0.12.2 vscode-docker|ms-|1.28.0 csharp|ms-|2.13.10 vscode-dotnet-runtime|ms-|2.0.0 remote-containers|ms-|0.327.0 azure-account|ms-|0.11.6 vim|vsc|1.27.1 volar|Vue|1.8.25 vscode-typescript-vue-plugin|Vue|1.8.25
bpasero commented 10 months ago

/duplicate https://github.com/microsoft/vscode/issues/15135

vscodenpa commented 10 months ago

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for similar existing issues. See also our issue reporting guidelines.

Happy Coding!