mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 11:38:51 +01:00
Introduce GlobPattern and adopt in DocumentFilter/FileWatcher/FileSearch (#34695)
* introduce IRelativePattern and use in extension API * 💄 * docs * introduce RelativePattern * support RelativePattern also for file watcher * also make findFiles support RelativePattern * less type conversion * add GlobPattern type and remove readonly * make base a string * fix setter access to RelativePattern * fix npe when exclude is undefined * fix findFiles: pattern seems to be matched against workspace always * 💄 * clarify glob pattern matching
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import { Disposable } from './extHostTypes';
|
||||
import { parse } from 'vs/base/common/glob';
|
||||
import { parse, IRelativePattern } from 'vs/base/common/glob';
|
||||
import { Uri, FileSystemWatcher as _FileSystemWatcher } from 'vscode';
|
||||
import { FileSystemEvents, ExtHostFileSystemEventServiceShape } from './extHost.protocol';
|
||||
|
||||
@@ -30,7 +30,7 @@ class FileSystemWatcher implements _FileSystemWatcher {
|
||||
return Boolean(this._config & 0b100);
|
||||
}
|
||||
|
||||
constructor(dispatcher: Event<FileSystemEvents>, globPattern: string, ignoreCreateEvents?: boolean, ignoreChangeEvents?: boolean, ignoreDeleteEvents?: boolean) {
|
||||
constructor(dispatcher: Event<FileSystemEvents>, globPattern: string | IRelativePattern, ignoreCreateEvents?: boolean, ignoreChangeEvents?: boolean, ignoreDeleteEvents?: boolean) {
|
||||
|
||||
this._config = 0;
|
||||
if (ignoreCreateEvents) {
|
||||
@@ -96,7 +96,7 @@ export class ExtHostFileSystemEventService implements ExtHostFileSystemEventServ
|
||||
constructor() {
|
||||
}
|
||||
|
||||
public createFileSystemWatcher(globPattern: string, ignoreCreateEvents?: boolean, ignoreChangeEvents?: boolean, ignoreDeleteEvents?: boolean): _FileSystemWatcher {
|
||||
public createFileSystemWatcher(globPattern: string | IRelativePattern, ignoreCreateEvents?: boolean, ignoreChangeEvents?: boolean, ignoreDeleteEvents?: boolean): _FileSystemWatcher {
|
||||
return new FileSystemWatcher(this._emitter.event, globPattern, ignoreCreateEvents, ignoreChangeEvents, ignoreDeleteEvents);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user