Skip to content

Commit

Permalink
Search provider pattern switches should not be optional - #45000
Browse files Browse the repository at this point in the history
  • Loading branch information
roblourens committed Jun 8, 2018
1 parent 79f78d6 commit 8f8ed32
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/vs/vscode.proposed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
11 changes: 10 additions & 1 deletion src/vs/workbench/api/node/extHostSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 8f8ed32

Please sign in to comment.