Search provider pattern switches should not be optional - #45000

This commit is contained in:
Rob Lourens
2018-06-07 21:38:21 -07:00
parent 79f78d667b
commit 8f8ed32e73
2 changed files with 13 additions and 4 deletions

View File

@@ -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 <vscode.TextSearchQuery>{
isCaseSensitive: patternInfo.isCaseSensitive || false,
isRegExp: patternInfo.isRegExp || false,
isWordMatch: patternInfo.isWordMatch || false,
pattern: patternInfo.pattern
};
}
class FileSearchEngine {
private filePattern: string;
private normalizedFilePatternLowercase: string;