@@ -340,39 +340,24 @@ export const search_files_for_context_command = (
340340const search_files_by_keywords = async ( params : {
341341 files : string [ ]
342342 search_term : string
343- progress ?: vscode . Progress < { message ?: string ; increment ?: number } >
344- token ?: vscode . CancellationToken
345343} ) : Promise < string [ ] > => {
346344 const matched_files : string [ ] = [ ]
347- const total = params . files . length
348- let processed = 0
349- const increment = total > 0 ? ( 1 / total ) * 100 : 0
350345
351- // Escape special characters and treat multiple spaces as flexible whitespace
352346 const escaped_term = params . search_term . replace ( / [ . * + ? ^ $ { } ( ) | [ \] \\ ] / g, '\\$&' )
353347 const pattern = escaped_term . replace ( / \s + / g, '\\s+' )
354- const regex = new RegExp ( pattern , 'mi' ) // Case-insensitive, multiline
348+ const regex = new RegExp ( pattern , 'mi' )
355349
356350 for ( const file_path of params . files ) {
357- if ( params . token ?. isCancellationRequested ) break
358-
359351 try {
360352 const file_name = path . basename ( file_path )
361353
362- // Check filename first
363354 if ( regex . test ( file_name ) ) {
364355 matched_files . push ( file_path )
365356 continue
366357 }
367358
368- // Skip large files (> 1MB) to avoid performance issues
369359 const stats = await fs . promises . stat ( file_path )
370360 if ( stats . size > 1024 * 1024 ) {
371- processed ++
372- params . progress ?. report ( {
373- increment,
374- message : `${ processed } /${ total } `
375- } )
376361 continue
377362 }
378363
@@ -384,12 +369,6 @@ const search_files_by_keywords = async (params: {
384369 } catch ( error ) {
385370 // Ignore read errors (binary files, permissions, etc.)
386371 }
387-
388- processed ++
389- params . progress ?. report ( {
390- increment,
391- message : `${ processed } /${ total } `
392- } )
393372 }
394373
395374 return matched_files
0 commit comments