src/vs/workbench/api/common/extHostFileSystemEventService.ts/FileSystemWatcher/ensureWatching
class FileSystemWatcher:	private ensureWatching(mainContext: IMainContext, extension: IExtensionDescription, globPattern: string | IRelativePatternDto): Disposable {
		const disposable = Disposable.from();

		if (typeof globPattern === 'string') {
			return disposable; // a pattern alone does not carry sufficient information to start watching anything
		}

		const proxy = mainContext.getProxy(MainContext.MainThreadFileSystem);

		let recursive = false;
		if (globPattern.pattern.includes(GLOBSTAR) || globPattern.pattern.includes(GLOB_SPLIT)) {
			recursive = true; // only watch recursively if pattern indicates the need for it
		}

		const session = Math.random();
		proxy.$watch(extension.identifier.value, session, globPattern.baseUri, { recursive, excludes: [] /* excludes are not yet surfaced in the API */ });

		return Disposable.from({ dispose: () => proxy.$unwatch(session) });
	}