Support first-class non-recursive file watching (à la VS Code)
#17.700 aperta il 23 giu 2026
Metriche repository
- Star
- (18.676 stelle)
- Metriche merge PR
- (Merge medio 15g 4h) (75 PR mergiate in 30 g)
Descrizione
Feature Description:
Follow-up to the review discussion in #17633 and the "root cause" option in #17632.
Theia's backend always watches recursively: DiskFileSystemProvider.watch forwards only { ignored } to the watcher server, and @parcel/watcher's subscribe() has no non-recursive mode. The recursive flag is carried from the frontend through RPC but dropped at the provider, so a non-recursive watch is silently turned into a full recursive crawl.
#17633 mitigates this by skipping non-recursive watches rooted at a strict ancestor of a workspace root, at the cost of losing workspace-folder-self-deletion detection for those watchers.
Proposal: honor recursive end-to-end by adding a dedicated non-recursive watcher (e.g. Node fs.watch(dir, { recursive: false })), mirroring VS Code, which routes non-recursive requests to its own NodeJSWatcher distinct from the recursive (parcel) one. This entails:
- threading
recursivethroughfilesystem-watcher-protocolWatchOptionsandDiskFileSystemProvider.watch; - a new backend non-recursive watcher with its own event mapping and cross-platform handling;
- routing non-recursive requests to it instead of parcel.
This would remove the need to drop ancestor watches and restore workspace-folder-self-deletion detection.