Skip to content

Commit 0afdd8f

Browse files
committed
feat(search): display total results in search output
1 parent 03a1b2b commit 0afdd8f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

core/src/main/kotlin/cc/unitmesh/devti/agenttool/search/RipgrepSearcher.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ object RipgrepSearcher {
132132
grouped.computeIfAbsent(relPath) { k: String? -> ArrayList<RipgrepSearchResult?>() }!!.add(result)
133133
}
134134

135+
output.append("Total results: ").append(results.size).append("\n\n")
135136
for (entry in grouped.entries) {
136137
output.append("## filepath: ").append(entry.key).append("\n")
137138
val filePath = Paths.get(basePath, entry.key)

exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/RipgrepSearchInsCommand.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class RipgrepSearchInsCommand(
2424
val searchContent = text ?: scope
2525
val result = RipgrepSearcher.searchFiles(myProject, searchDirectory, searchContent, null).get()
2626
return if (result?.isNotEmpty() == true) {
27-
"RipGrep Search Result ($searchContent): \n===============================$result\n===============================\n"
27+
"RipGrep Search Result ($searchContent): \n===============================\n$result\n===============================\n"
2828
} else {
2929
"No result found for /$commandName:$searchContent"
3030
}

0 commit comments

Comments
 (0)