Skip to content

Commit d2d97a9

Browse files
committed
update tip in @ menu
1 parent b94113f commit d2d97a9

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

npm-app/src/cli.ts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff 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`)

0 commit comments

Comments
 (0)