File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/providers/FileSystemProvider Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -340,6 +340,10 @@ export class TextSearchProvider implements vscode.TextSearchProvider {
340
340
} ) ;
341
341
} ;
342
342
343
+ // Generate the query pattern that gets sent to the server
344
+ // Needed because the server matches the full line against the regex and ignores the case parameter when in regex mode
345
+ const pattern = query . isRegExp ? `${ ! query . isCaseSensitive ? "(?i)" : "" } .*${ query . pattern } .*` : query . pattern ;
346
+
343
347
if ( api . config . apiVersion >= 6 ) {
344
348
// Build the request object
345
349
const project = params . has ( "project" ) && params . get ( "project" ) . length ? params . get ( "project" ) : undefined ;
@@ -352,7 +356,7 @@ export class TextSearchProvider implements vscode.TextSearchProvider {
352
356
const request : AsyncSearchRequest = {
353
357
request : "search" ,
354
358
console : false , // Passed so the server doesn't send us back console output
355
- query : query . pattern ,
359
+ query : pattern ,
356
360
regex : query . isRegExp ,
357
361
project,
358
362
word : query . isWordMatch , // Ignored if regex is true
@@ -473,7 +477,7 @@ export class TextSearchProvider implements vscode.TextSearchProvider {
473
477
throttleRequests ( ( group : string [ ] ) =>
474
478
api
475
479
. actionSearch ( {
476
- query : query . pattern ,
480
+ query : pattern ,
477
481
regex : query . isRegExp ,
478
482
word : query . isWordMatch ,
479
483
case : query . isCaseSensitive ,
@@ -553,7 +557,7 @@ export class TextSearchProvider implements vscode.TextSearchProvider {
553
557
554
558
searchPromise = api
555
559
. actionSearch ( {
556
- query : query . pattern ,
560
+ query : pattern ,
557
561
regex : query . isRegExp ,
558
562
word : query . isWordMatch ,
559
563
case : query . isCaseSensitive ,
You can’t perform that action at this time.
0 commit comments