1172
watch(resource: URI, options?: IWatchOptionsWithoutCorrelation): IDisposable;
1173
watch(resource: URI, options: IWatchOptions = { recursive: false, excludes: [] }): IFileSystemWatcher | IDisposable {
1175
>
1176
>
// Forward watch request to provider and wire in disposables
1177
>
let watchDisposed = false;
1178
>
let disposeWatch = () => { watchDisposed = true; };
1179
>
disposables.add(toDisposable(() => disposeWatch()));
1180
>
1181
>
// Watch and wire in disposable which is async but
1182
>
// check if we got disposed meanwhile and forward
1183
>
(async () => {
1184
>
try {
1185
>
const disposable = await this.doWatch(resource, options);
1186
if (watchDisposed) {
1187
dispose(disposable);