File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
core/src/main/kotlin/cc/unitmesh/devti/agenttool/search
exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,11 @@ object RipgrepSearcher {
30
30
): CompletableFuture <String ?> {
31
31
return CompletableFuture .supplyAsync<String > {
32
32
try {
33
- val rgPath = findRipgrepBinary() ? : throw IOException (" Ripgrep binary not found" )
33
+ val rgPath = findRipgrepBinary()
34
+ if (rgPath == null ) {
35
+ return @supplyAsync " Ripgrep binary not found, try install it first: https://github.com/BurntSushi/ripgrep?tab=readme-ov-file#installation
36
+ }
37
+
34
38
val results = executeRipgrep(
35
39
project,
36
40
rgPath,
@@ -59,7 +63,6 @@ object RipgrepSearcher {
59
63
}
60
64
}
61
65
62
-
63
66
val pb = ProcessBuilder(" which" , binName)
64
67
val process = pb.start()
65
68
try {
Original file line number Diff line number Diff line change @@ -12,7 +12,11 @@ class RipgrepSearchInsCommand(
12
12
override val commandName: BuiltinCommand = BuiltinCommand .RIPGREP_SEARCH
13
13
14
14
override fun isApplicable (): Boolean {
15
- return RipgrepSearcher .findRipgrepBinary() != null
15
+ return try {
16
+ RipgrepSearcher .findRipgrepBinary() != null
17
+ } catch (e: Exception ) {
18
+ false
19
+ }
16
20
}
17
21
18
22
override suspend fun execute (): String? {
You can’t perform that action at this time.
0 commit comments