File tree Expand file tree Collapse file tree
packages/vscode/src/context/providers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -386,17 +386,19 @@ export class WorkspaceProvider
386386
387387 private async _handle_file_create ( created_file_path ?: string ) : Promise < void > {
388388 if ( created_file_path ) {
389- const parent_dir = path . dirname ( created_file_path )
390- const parent_state = this . checked_items . get ( parent_dir )
391-
392- if ( parent_state == vscode . TreeItemCheckboxState . Checked ) {
393- if ( ! should_ignore_file ( created_file_path , this . ignored_extensions ) ) {
394- this . checked_items . set (
395- created_file_path ,
396- vscode . TreeItemCheckboxState . Checked
397- )
398- this . _on_did_change_checked_files . fire ( )
389+ if ( ! should_ignore_file ( created_file_path , this . ignored_extensions ) ) {
390+ this . checked_items . set (
391+ created_file_path ,
392+ vscode . TreeItemCheckboxState . Checked
393+ )
394+ let dir_path = path . dirname ( created_file_path )
395+ const workspace_root =
396+ this . get_workspace_root_for_file ( created_file_path )
397+ while ( workspace_root && dir_path . startsWith ( workspace_root ) ) {
398+ await this . _update_parent_state ( dir_path )
399+ dir_path = path . dirname ( dir_path )
399400 }
401+ this . _on_did_change_checked_files . fire ( )
400402 }
401403
402404 this . file_token_counts . delete ( created_file_path )
You can’t perform that action at this time.
0 commit comments