File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -548,11 +548,19 @@ class VsCodeIde implements IDE {
548
548
results . push ( dirResults ) ;
549
549
}
550
550
551
+ const allResults = results . join ( "\n" ) ;
551
552
if ( maxResults ) {
552
- // With multiple workspaces, we will pull max results from EACH workspace and then truncate to max results just in case
553
- return results . join ( "\n" ) . split ( "\n./" ) . slice ( 0 , maxResults ) . join ( "\n./" ) ;
553
+ // In case of multiple workspaces, do max results per workspace and then truncate to maxResults
554
+ // Will prioritize first workspace results, fine for now
555
+ // Results are separated by either ./ or --
556
+ const matches = Array . from ( allResults . matchAll ( / ( \n - - | \n \. \/ ) / g) ) ;
557
+ if ( matches . length > maxResults ) {
558
+ return allResults . substring ( 0 , matches [ maxResults ] . index ) ;
559
+ } else {
560
+ return allResults ;
561
+ }
554
562
} else {
555
- return results . join ( "\n" ) ;
563
+ return allResults ;
556
564
}
557
565
}
558
566
You can’t perform that action at this time.
0 commit comments