/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { Event, RelativePattern, Uri, workspace } from 'vscode';6import { IDisposable, anyEvent } from './util';78export interface IFileWatcher extends IDisposable {9readonly event: Event<Uri>;10}1112export function watch(location: string): IFileWatcher {13const watcher = workspace.createFileSystemWatcher(new RelativePattern(location, '*'));1415return new class implements IFileWatcher {16event = anyEvent(watcher.onDidCreate, watcher.onDidChange, watcher.onDidDelete);17dispose() {18watcher.dispose();19}20};21}222324