File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed
Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -508,12 +508,25 @@ export class CLI {
508508 return null
509509 }
510510 const allFiles = this . getAllFilePaths ( client . fileContext . fileTree )
511- // high priority first
511+ // low priority first
512512 function priority ( filePath : string ) : number {
513- if ( ! filePath . endsWith ( '/' ) ) {
514- return 0
513+ let p = 0
514+ if ( filePath . endsWith ( '/' ) ) {
515+ return 1
515516 }
516- return 1
517+
518+ let hasPrefix = false
519+ while ( filePath . includes ( searchTerm ) ) {
520+ if ( filePath . startsWith ( searchTerm ) ) {
521+ hasPrefix = true
522+ }
523+ filePath = filePath . split ( path . sep ) . slice ( 1 ) . join ( path . sep )
524+ }
525+ if ( ! hasPrefix ) {
526+ p += 2
527+ }
528+
529+ return p
517530 }
518531 const matchingPaths = uniq (
519532 allFiles
@@ -638,7 +651,7 @@ export class CLI {
638651 } )
639652
640653 const tip = gray (
641- 'Tip: Type "@" followed by an agent name to request a specific agent, e.g., @reid find relevant files' ,
654+ 'Tip: Type "@" followed by an agent name to request a specific agent\n- You can also use "@" to search for files' ,
642655 )
643656
644657 console . log ( `\n\n${ agentLines . join ( '\n' ) } \n${ tip } \n` )
You can’t perform that action at this time.
0 commit comments