diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 9c122fa03e3df..7f06347070389 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -15,9 +15,9 @@ declare module 'vscode' { export interface TextSearchQuery { pattern: string; - isRegExp?: boolean; - isCaseSensitive?: boolean; - isWordMatch?: boolean; + isRegExp: boolean; + isCaseSensitive: boolean; + isWordMatch: boolean; } export interface SearchOptions { diff --git a/src/vs/workbench/api/node/extHostSearch.ts b/src/vs/workbench/api/node/extHostSearch.ts index 0f8c774dd7304..c4cf892bd17ce 100644 --- a/src/vs/workbench/api/node/extHostSearch.ts +++ b/src/vs/workbench/api/node/extHostSearch.ts @@ -454,7 +454,7 @@ class TextSearchEngine { new TPromise(resolve => process.nextTick(resolve)) .then(() => { this.activeCancellationTokens.add(cancellation); - return this.provider.provideTextSearchResults(this.pattern, searchOptions, progress, cancellation.token); + return this.provider.provideTextSearchResults(patternInfoToQuery(this.pattern), searchOptions, progress, cancellation.token); }) .then(() => { this.activeCancellationTokens.delete(cancellation); @@ -500,6 +500,15 @@ class TextSearchEngine { } } +function patternInfoToQuery(patternInfo: IPatternInfo): vscode.TextSearchQuery { + return { + isCaseSensitive: patternInfo.isCaseSensitive || false, + isRegExp: patternInfo.isRegExp || false, + isWordMatch: patternInfo.isWordMatch || false, + pattern: patternInfo.pattern + }; +} + class FileSearchEngine { private filePattern: string; private normalizedFilePatternLowercase: string;