Skip to content

Commit 0f49740

Browse files
committed
Implement automatic checking for newly created files when their parent directory is already checked
1 parent 8b7cbb4 commit 0f49740

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎packages/vscode/src/context/providers/workspace-provider.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,19 @@ export class WorkspaceProvider
370370

371371
private async _handle_file_create(created_file_path?: string): Promise<void> {
372372
if (created_file_path) {
373+
const parent_dir = path.dirname(created_file_path)
374+
const parent_state = this.checked_items.get(parent_dir)
375+
376+
if (parent_state == vscode.TreeItemCheckboxState.Checked) {
377+
if (!should_ignore_file(created_file_path, this.ignored_extensions)) {
378+
this.checked_items.set(
379+
created_file_path,
380+
vscode.TreeItemCheckboxState.Checked
381+
)
382+
this._on_did_change_checked_files.fire()
383+
}
384+
}
385+
373386
this.file_token_counts.delete(created_file_path)
374387

375388
let dir_path = path.dirname(created_file_path)

0 commit comments

Comments
 (0)