MCPcopy Index your code
hub / github.com/angular/angular / watchFile

Method watchFile

vscode-ng-language-service/server/src/server_host.ts:66–90  ·  view source on GitHub ↗

* @pollingInterval - this parameter is used in polling-based watchers and * ignored in watchers that use native OS file watching

(
    path: string,
    callback: ts.FileWatcherCallback,
    pollingInterval?: number,
    options?: ts.WatchOptions,
  )

Source from the content-addressed store, hash-verified

64 * ignored in watchers that use native OS file watching
65 */
66 watchFile(
67 path: string,
68 callback: ts.FileWatcherCallback,
69 pollingInterval?: number,
70 options?: ts.WatchOptions,
71 ): ts.FileWatcher {
72 if (!this.useClientSideFileWatcher) {
73 return ts.sys.watchFile!(path, callback, pollingInterval, options);
74 }
75
76 const callbacks = this.fileWatchers.get(path) ?? new Set();
77 callbacks.add(callback);
78 this.fileWatchers.set(path, callbacks);
79 return {
80 close: () => {
81 const callbacks = this.fileWatchers.get(path);
82 if (callbacks) {
83 callbacks.delete(callback);
84 if (callbacks.size === 0) {
85 this.fileWatchers.delete(path);
86 }
87 }
88 },
89 };
90 }
91
92 watchDirectory(
93 path: string,

Callers

nothing calls this directly

Calls 4

getMethod · 0.65
addMethod · 0.65
setMethod · 0.65
deleteMethod · 0.45

Tested by

no test coverage detected