microsoft / vscode

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

"Ghost" entry created when switching between "new file" and "new folder" in Explorer pane with compact folders enabled #229233

Open aescarias opened 6 hours ago

aescarias commented 6 hours ago

Type: Bug

When attempting to switch between "New file" and "New folder" (as in first clicking new file then new folder or viceversa) with the "compact folders" option on, a "ghost" entry is created. This entry does not exist in the file system and disappears when refreshing the explorer pane.

Steps to reproduce:

  1. Create a new parent folder and add another folder as a child. This way, with "compact folders", it should look something like this: parent/child.
  2. Select the parent folder and click on "New File"
  3. Now switch to a folder by clicking "New Folder"
  4. A new entry should be visible (which is the bug in question)

I will attach a video demonstrating the issue below.

Code_hRbVc3j24o

VS Code version: Code 1.93.1 (38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40, 2024-09-11T17:20:05.685Z) OS version: Windows_NT x64 10.0.19045 Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i3-7020U CPU @ 2.30GHz (4 x 2304)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
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
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off| |Load (avg)|undefined| |Memory (System)|15.87GB (3.74GB free)| |Process Argv|--folder-uri file:///c%3A/Users/Micro/Code/Web/lilac-lms --crash-reporter-id cc3cc104-37cd-4fd4-bbb3-0a16175e626f| |Screen Reader|no| |VM|0%|
Extensions disabled
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492:30256859 vscod805:30301674 binariesv615:30325510 vsaa593:30376534 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30959799 pythongtdpath:30769146 welcomedialogc:30910334 pythonnoceb:30805159 asynctok:30898717 pythonmypyd1:30879173 h48ei257:31000450 pythontbext0:30879054 accentitlementsc:30995553 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 f3je6385:31013174 a69g1124:31058053 dvdeprecation:31068756 dwnewjupytercf:31046870 impr_priority:31102340 nativerepl1:31139838 refactort:31108082 pythonrstrctxt:31112756 flighttreat:31134774 wkspc-onlycs-t:31132770 nativeloc1:31134641 wkspc-ranged-c:31125598 ei213698:31121563 iacca2:31138163 cc771715:31140165 ```
rezwanahmedsami commented 6 hours ago

Type: Bug

When attempting to switch between "New file" and "New folder" (as in first clicking new file then new folder or viceversa) with the "compact folders" option on, a "ghost" entry is created. This entry does not exist in the file system and disappears when refreshing the explorer pane.

Steps to reproduce:

  1. Create a new parent folder and add another folder as a child. This way, with "compact folders", it should look something like this: parent/child.
  2. Select the parent folder and click on "New File"
  3. Now switch to a folder by clicking "New Folder"
  4. A new entry should be visible (which is the bug in question)

I will attach a video demonstrating the issue below.

Code_hRbVc3j24o Code_hRbVc3j24o

VS Code version: Code 1.93.1 (38c31bc, 2024-09-11T17:20:05.685Z) OS version: Windows_NT x64 10.0.19045 Modes:

System Info Extensions disabled A/B Experiments

Let me try to fix it