eclipse-theia/theia

Support first-class non-recursive file watching (à la VS Code)

Ouverte

#17 700 ouverte le 23 juin 2026

 (0 commentaire) (0 réaction) (0 personne assignée)TypeScript (2 478 forks)batch import
enhancementfile-watchersfilesystemhelp wanted

Métriques du dépôt

Stars
 (18 676 étoiles)
Métriques de merge PR
 (Merge moyen 15j 4h) (75 PRs mergées en 30 j)

Description

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 recursive through filesystem-watcher-protocol WatchOptions and DiskFileSystemProvider.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.

Guide contributeur