Skip to content

Commit ae1264d

Browse files
committed
Add early return guards for edge cases in file creation handler
- programmatic removal of ignored folder with rimraf causes context selection to be cleared - should not. Logged error: [Pasted text] ├── apps │ └── editor │ └── src │ ├── commands │ │ └── history-command │ │ └── actions │ │ └── restore-checkpoint.ts │ ├── constants │ │ ├── ignored-lock-files.ts │ │ └── state-keys.ts │ ├── context │ │ ├── context-initialization.ts │ │ ├── helpers │ │ │ ├── get-all-workspace-files.ts │ │ │ └── get-selected-files.ts │ │ ├── providers │ │ │ ├── open-editors │ │ │ │ └── open-editors-provider.ts │ │ │ ├── selected-files │ │ │ │ └── selected-files-provider.ts │ │ │ └── workspace │ │ │ ├── modules │ │ │ │ ├── index.ts │ │ │ │ └── token-calculator.ts │ │ │ └── workspace-provider.ts │ │ └── shared-context-state.ts │ └── utils │ ├── global-workspace-storage.ts │ ├── ignore │ │ ├── ignore.ts │ │ └── index.ts │ ├── is-binary.ts │ ├── natural-sort.ts │ └── normalize-path.ts └── packages └── shared └── src └── utils ├── display-token-count.ts └── logger.ts
1 parent e472805 commit ae1264d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎apps/editor/src/context/providers/workspace/workspace-provider.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,15 @@ export class WorkspaceProvider
469469
return
470470
}
471471

472+
if (
473+
created_file_path === workspace_root ||
474+
this._checked_items.has(created_file_path) ||
475+
!fs.existsSync(created_file_path)
476+
) {
477+
this._schedule_refresh()
478+
return
479+
}
480+
472481
this._file_workspace_map.set(created_file_path, workspace_root)
473482
const parent_dir = path.dirname(created_file_path)
474483

0 commit comments

Comments
 (0)