@@ -10,6 +10,7 @@ import cc.unitmesh.devti.provider.context.ChatCreationContext
10
10
import cc.unitmesh.devti.provider.context.ChatOrigin
11
11
import cc.unitmesh.devti.sketch.run.ShellUtil
12
12
import cc.unitmesh.devti.template.context.TemplateContext
13
+ import com.intellij.openapi.diagnostic.logger
13
14
import com.intellij.openapi.editor.Editor
14
15
import com.intellij.openapi.fileEditor.FileDocumentManager
15
16
import com.intellij.openapi.fileEditor.FileEditorManager
@@ -72,20 +73,25 @@ data class SketchRunContext(
72
73
return @runBlocking ChatContextProvider .collectChatContextList(project, creationContext)
73
74
}.joinToString(" ," , transform = ChatContextItem ::text),
74
75
buildTool = buildTool,
75
- searchTool = getSearchTool ()
76
+ searchTool = lookupSearchTool ()
76
77
)
77
78
}
78
79
}
79
80
}
80
81
81
- fun getSearchTool (): String {
82
+ fun lookupSearchTool (): String {
82
83
val findRipgrepBinary = try {
83
84
RipgrepSearcher .findRipgrepBinary()
84
- } catch (e : Exception ) {
85
+ } catch (_ : Exception ) {
85
86
null
86
87
}
87
88
88
- return if (findRipgrepBinary != null ) " ripgrepSearch" else " localSearch"
89
+ return if (findRipgrepBinary != null ) {
90
+ " ripgrepSearch"
91
+ } else {
92
+ logger<SketchRunContext >().warn(" Ripgrep binary not found, fallback to local search" )
93
+ " localSearch"
94
+ }
89
95
}
90
96
91
97
private fun osInfo () =
0 commit comments