File tree Expand file tree Collapse file tree
packages/vscode/src/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,7 +103,16 @@ function condense_paths(
103103
104104 const condensed_paths = new Set ( relative_paths )
105105
106- const directories = Array . from ( dir_to_children . keys ( ) )
106+ const all_dirs_set = new Set < string > ( )
107+ for ( const dir of dir_to_children . keys ( ) ) {
108+ let current_dir = dir
109+ while ( current_dir != '.' && current_dir != '/' ) {
110+ all_dirs_set . add ( current_dir )
111+ current_dir = path . dirname ( current_dir )
112+ }
113+ }
114+
115+ const directories = Array . from ( all_dirs_set )
107116 directories . sort (
108117 ( a , b ) => b . split ( path . sep ) . length - a . split ( path . sep ) . length
109118 )
@@ -113,7 +122,7 @@ function condense_paths(
113122 if ( dir == '.' ) continue
114123
115124 if ( are_all_files_selected ( dir , condensed_paths ) ) {
116- for ( const file of dir_to_children . get ( dir ) ! ) {
125+ for ( const file of dir_to_children . get ( dir ) || [ ] ) {
117126 condensed_paths . delete ( file )
118127 }
119128
You can’t perform that action at this time.
0 commit comments