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:
Benjamin Pasero
2017-09-22 13:52:23 +02:00
committed by GitHub
parent 9e05d4b635
commit 3e9fa59616
11 changed files with 169 additions and 38 deletions

View File

@@ -14,6 +14,7 @@ import { IWorkspaceData, ExtHostWorkspaceShape, MainContext, MainThreadWorkspace
import * as vscode from 'vscode';
import { compare } from 'vs/base/common/strings';
import { TrieMap } from 'vs/base/common/map';
import { IRelativePattern } from 'vs/base/common/glob';
class Workspace2 extends Workspace {
@@ -156,7 +157,7 @@ export class ExtHostWorkspace implements ExtHostWorkspaceShape {
// --- search ---
findFiles(include: string, exclude: string, maxResults?: number, token?: vscode.CancellationToken): Thenable<vscode.Uri[]> {
findFiles(include: string | IRelativePattern, exclude: string | IRelativePattern, maxResults?: number, token?: vscode.CancellationToken): Thenable<vscode.Uri[]> {
const requestId = ExtHostWorkspace._requestIdPool++;
const result = this._proxy.$startSearch(include, exclude, maxResults, requestId);
if (token) {