API: Allow to use the file watcher for aribitrary folders (#3025) (#139881)

* API: Allow to use the file watcher for aribitrary folders (#3025)

* fix tests

* update `createFileSystemWatcher` docs

* refuse to watch resources that are watched in workspace already

* properly check proposed API

* make it work via `createFileSystemWacher` (first cut)

* more docs

* cleanup

* enable recursive watching based on pattern

* add tests

* drop out-of-workspace events when using simple patterns

* do not apply excludes when watchig files

* log extension watch requests

* also log unwatch

* improved exclude handling

* more docs

* drop proposed api needs

* remove `suite.only`

* cannot watch inside workspace more than once

* do not send extension decriptor over

* adopt latest changes

* add `baseUri` to relative pattern

* backwards compat
This commit is contained in:
Benjamin Pasero
2022-01-13 13:32:03 +01:00
committed by GitHub
parent 0cfa366323
commit e3cf7e5e1b
13 changed files with 301 additions and 64 deletions

View File

@@ -579,7 +579,7 @@ export class ExtHostWorkspace implements ExtHostWorkspaceShape, IExtHostWorkspac
export const IExtHostWorkspace = createDecorator<IExtHostWorkspace>('IExtHostWorkspace');
export interface IExtHostWorkspace extends ExtHostWorkspace, ExtHostWorkspaceShape, IExtHostWorkspaceProvider { }
function parseSearchInclude(include: RelativePattern | string | undefined): { includePattern?: string, folder?: URI; } {
function parseSearchInclude(include: RelativePattern | vscode.GlobPattern | string | undefined): { includePattern?: string, folder?: URI; } {
let includePattern: string | undefined;
let includeFolder: URI | undefined;
if (include) {
@@ -587,7 +587,7 @@ function parseSearchInclude(include: RelativePattern | string | undefined): { in
includePattern = include;
} else {
includePattern = include.pattern;
includeFolder = include.baseFolder || URI.file(include.base);
includeFolder = include.baseUri;
}
}