File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
core/src/main/kotlin/cc/unitmesh/devti/mcp/host Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -304,11 +304,11 @@ class FindFilesByNameSubstring : AbstractMcpTool<Query>() {
304304 val projectDir = project.guessProjectDir()?.toNioPathOrNull()
305305 ? : return Response (error = " project dir not found" )
306306
307- val searchSubstring = args.nameSubstring.toLowerCase ()
307+ val searchSubstring = args.nameSubstring.lowercase ()
308308 return runReadAction {
309309 Response (
310310 FilenameIndex .getAllFilenames(project)
311- .filter { it.toLowerCase ().contains(searchSubstring) }
311+ .filter { it.lowercase ().contains(searchSubstring) }
312312 .flatMap {
313313 FilenameIndex .getVirtualFilesByName(it, GlobalSearchScope .projectScope(project))
314314 }
@@ -319,12 +319,10 @@ class FindFilesByNameSubstring : AbstractMcpTool<Query>() {
319319 } catch (e: IllegalArgumentException ) {
320320 false
321321 }
322- }
323- .map { file ->
322+ }.joinToString(" ,\n " , prefix = " [" , postfix = " ]" ) { file ->
324323 val relativePath = projectDir.relativize(Path (file.path)).toString()
325324 """ {"path": "$relativePath ", "name": "${file.name} "}"""
326325 }
327- .joinToString(" ,\n " , prefix = " [" , postfix = " ]" )
328326 )
329327 }
330328 }
You can’t perform that action at this time.
0 commit comments