@@ -377,31 +377,28 @@ export class TextSearchProvider implements vscode.TextSearchProvider {
377377 max : options . maxResults ?? 100000 ,
378378 } ;
379379
380- // Generate the include and exclude filters, except for if 'flat' is present
381- // because there isn't an easy way to convert all dots to slashes except for file extensions.
380+ // Generate the include and exclude filters.
382381 // The matching is case sensitive and file names are normalized so that the first character
383382 // and path separator are '/' (for example, '/%Api/Atelier/v6.cls' and '/csp/user/menu.csp').
384- if ( params . has ( "flat" ) && params . get ( "flat" ) . length ? params . get ( "flat" ) != "1" : true ) {
385- let includesArr = options . includes ;
386- let excludesArr = removeConfigExcludes ( options . folder , options . excludes ) ;
387- if ( ! [ "" , "/" ] . includes ( options . folder . path ) ) {
388- // Prepend path with a trailing slash
389- const prefix = ! options . folder . path . endsWith ( "/" ) ? `${ options . folder . path } /` : options . folder . path ;
390- includesArr = includesArr . map ( ( e ) => `${ prefix } ${ e } ` ) ;
391- excludesArr = excludesArr . map ( ( e ) => `${ prefix } ${ e } ` ) ;
392- }
383+ let includesArr = options . includes ;
384+ let excludesArr = removeConfigExcludes ( options . folder , options . excludes ) ;
385+ if ( ! [ "" , "/" ] . includes ( options . folder . path ) ) {
386+ // Prepend path with a trailing slash
387+ const prefix = ! options . folder . path . endsWith ( "/" ) ? `${ options . folder . path } /` : options . folder . path ;
388+ includesArr = includesArr . map ( ( e ) => `${ prefix } ${ e } ` ) ;
389+ excludesArr = excludesArr . map ( ( e ) => `${ prefix } ${ e } ` ) ;
390+ }
393391
394- // Add leading slash if we don't start with **/
395- includesArr = includesArr . map ( ( e ) => ( ! e . startsWith ( "**/" ) ? `/${ e } ` : e ) ) ;
396- excludesArr = excludesArr . map ( ( e ) => ( ! e . startsWith ( "**/" ) ? `/${ e } ` : e ) ) ;
392+ // Add leading slash if we don't start with **/
393+ includesArr = includesArr . map ( ( e ) => ( ! e . startsWith ( "**/" ) ? `/${ e } ` : e ) ) ;
394+ excludesArr = excludesArr . map ( ( e ) => ( ! e . startsWith ( "**/" ) ? `/${ e } ` : e ) ) ;
397395
398- // Convert the array of glob patterns into a single regular expression
399- if ( includesArr . length ) {
400- request . include = includesArr . map ( ( e ) => makeRe ( e ) . source ) . join ( "|" ) ;
401- }
402- if ( excludesArr . length ) {
403- request . exclude = excludesArr . map ( ( e ) => makeRe ( e ) . source ) . join ( "|" ) ;
404- }
396+ // Convert the array of glob patterns into a single regular expression
397+ if ( includesArr . length ) {
398+ request . include = includesArr . map ( ( e ) => makeRe ( e ) . source ) . join ( "|" ) ;
399+ }
400+ if ( excludesArr . length ) {
401+ request . exclude = excludesArr . map ( ( e ) => makeRe ( e ) . source ) . join ( "|" ) ;
405402 }
406403
407404 // Send the queue request
@@ -596,30 +593,6 @@ export class TextSearchProvider implements vscode.TextSearchProvider {
596593 }
597594 }
598595
599- // Don't report matches in filetypes we don't want or don't handle
600- const fileType = file . doc . split ( "." ) . pop ( ) . toLowerCase ( ) ;
601- if ( ! csp ) {
602- switch ( params . get ( "type" ) ) {
603- case "cls" :
604- if ( fileType !== "cls" ) {
605- return ;
606- }
607- break ;
608-
609- case "rtn" :
610- if ( ! [ "inc" , "int" , "mac" ] . includes ( fileType ) ) {
611- return ;
612- }
613- break ;
614-
615- default :
616- if ( ! [ "cls" , "inc" , "int" , "mac" ] . includes ( fileType ) ) {
617- return ;
618- }
619- break ;
620- }
621- }
622-
623596 return reportMatchesForFile ( file ) ;
624597 } )
625598 )
0 commit comments