microsoft / vscode

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

Freezes when creating a new file while sidebar closed #111218

Closed ghost closed 3 years ago

ghost commented 3 years ago

Issue Type: Bug

  1. Have sidebar closed
  2. Create a new file with the shortcut, CTRL+N
  3. It opens the sidebar, but empty
  4. It freezes and then, after a few seconds, comes up with the option to reload the window

I can't reproduce it on WSL2, which runs off my SSD.

In the past, I've noticed it takes a while for a file to save to my HDD, likely due to Windows turning it off after a period of inactivity. However, I've never had VS Code crash before.

VS Code version: Code - Insiders 1.52.0-insider (caf01baa45b9816e2e1d8a2de22b40cf89459c03, 2020-11-20T07:41:44.570Z) OS version: Windows_NT x64 10.0.19041

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 5 1600 Six-Core Processor (6 x 3194)| |GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|23.94GB (14.93GB free)| |Process Argv|W:/tasks --crash-reporter-id c73e6220-0e92-4959-bd5b-dad20a05ae32| |Screen Reader|no| |VM|0%|
Extensions (15) Extension|Author (truncated)|Version ---|---|--- better-comments|aar|2.1.0 Bookmarks|ale|11.4.0 project-manager|ale|12.0.0 chalice-icon-theme|art|1.2.9 bracket-pair-colorizer-2|Coe|0.2.0 doxdocgen|csc|1.1.0 vscode-todo-plus|fab|4.18.0 go|gol|0.18.1 docomment|k--|0.1.19 rust-analyzer|mat|0.2.328 csharp|ms-|1.23.5 remote-wsl|ms-|0.51.3 cpptools|ms-|1.1.2 vscode-subword-navigation|ow|1.2.0 ayu|tea|0.20.1 (3 theme extensions excluded)
isidorn commented 3 years ago

I can not reproduce this. I guess you have a custom shortcut to create a new file, since Ctrl + N by default would just open an untitle file and that does not open the sidebar. Can you reproduce with all extensions disabled? Can you attach a gif showing this issue?

ghost commented 3 years ago

I guess you have a custom shortcut to create a new file, since Ctrl + N by default would just open an untitle file and that does not open the sidebar.

Yeah. I also just tested creating a new file from the Command Palette, and encountered the same issue.

Can you reproduce with all extensions disabled?

Yes. Had it freeze. Disabled all the extensions in another VS Code instance so that when I reopened, it'd have none enabled. Tried to create a new file again, and it still froze.

Can you attach a gif showing this issue?

Here is it freezing a second time, before I reopened it with all extensions disabled.

vscode_freeze

This time round, I'd just turned my PC on like 5-10 mins before. I don't think that has too much weight though as my PC had been on 3-4 hours before the initial report.

It may have to do with the fact that I open several projects in quick succession. However, they are all under 10 files.

isidorn commented 3 years ago

Thanks for more details. I can repro something similar, but not 100% the same.

  1. Have sidebar closed, reload
  2. F1 > new file
  3. Explorer is grayed out, there is no New File input

I can try to fix this and hopefully that will fix your issue as well -> thus assigning to November

isidorn commented 3 years ago

Good catch. unforutnetly I was only able to resolve it using a timeout which is a bit ugly. The problem is that the explorer gets shown and it is not yet fully resovled. Alternative solution would be for me to add events that the explorer emits once it is ready. Will add that if this issue shows up in more places

ghost commented 3 years ago

No worries! Thanks for taking a look at it.

Will keep an eye out, and see if I can narrow the issue down.

isidorn commented 3 years ago

It should be fixed now. At least it is on my machine. But the fix is not that pretty.

github-actions[bot] commented 3 years ago

This bug has been fixed in to the latest release of VS Code Insiders!

@DeviantGhost0, you can help us out by confirming things are working as expected in the latest Insiders release. If things look good, please leave a comment with the text /verified to let us know. If not, please ensure you're on version f4187f22026ff6537f2ca8132ad3209fceb5071f of Insiders (today's or later - you can use Help: About in the command palette to check), and leave a comment letting us know what isn't working as expected.

Happy Coding!