Theia API Documentation v1.77.0
    Preparing search index...

    Watches one directory level with Node's fs.watch.

    One instance serves every non-recursive request resolving to the same directory, for the directory itself or for a single file in it. Sharing saves more than handles: on macOS libuv keeps one FSEventStream per event loop and rebuilds it whenever a handle opens or closes, losing every other watcher's events.

    Hierarchy (View Summary)

    Index
    children: Set<string> = ...

    Direct children of watchedDirectory, kept in sync to classify changes and to diff a rescan.

    host: WatcherHost = ...
    onDidResolveDirectory: Event<void> = ...

    Fires when directory changes, for example when a missing target appears as a file.

    Who asked, and what they excluded.

    target: string

    Path this watcher was asked about; the subclass decides what it resolves to.

    timings: NodeDirectoryWatcherTimings = DEFAULT_WATCHER_TIMINGS
    watchedDirectory: string

    What is being watched, and what changes are resolved against.

    watchPath: string

    The path polled and resolved on each start: the target, or its directory once it turned out to be a file.

    whenDisposed: Promise<void> = ...

    Resolves once this watcher disposed itself. Never rejects.

    whenStarted: Promise<void>

    Resolves once the watcher is up, or once it got disposed while starting. Never rejects.

    • Parameters

      • fileName: string
      • storedName: (fileName: string) => Promise<string | undefined>
          • (fileName: string): Promise<string | undefined>
          • The child's name on disk, which can differ from fileName in case, or undefined if there is none.

            Parameters

            • fileName: string

            Returns Promise<string | undefined>

      Returns Promise<ResolvedChange[]>

    • Resolves the target to the directory to watch. Requests made while the target was missing are resolved here too, and narrowed to the file if the target is one.

      Returns Promise<boolean>

      false if the path is a file that the watcher cannot follow to its parent.