overhaul file search and support @ mentioning directories

This commit is contained in:
Dax Raad
2025-10-01 03:37:01 -04:00
parent fe45a76c55
commit 6e19200fca
10 changed files with 132 additions and 27 deletions

View File

@@ -40,12 +40,14 @@ const FilesCommand = cmd({
}),
async handler(args) {
await bootstrap(process.cwd(), async () => {
const files = await Ripgrep.files({
const files: string[] = []
for await (const file of Ripgrep.files({
cwd: Instance.directory,
query: args.query,
glob: args.glob ? [args.glob] : undefined,
limit: args.limit,
})
})) {
files.push(file)
if (args.limit && files.length >= args.limit) break
}
console.log(files.join("\n"))
})
},