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>() {
304
304
val projectDir = project.guessProjectDir()?.toNioPathOrNull()
305
305
? : return Response (error = " project dir not found" )
306
306
307
- val searchSubstring = args.nameSubstring.toLowerCase ()
307
+ val searchSubstring = args.nameSubstring.lowercase ()
308
308
return runReadAction {
309
309
Response (
310
310
FilenameIndex .getAllFilenames(project)
311
- .filter { it.toLowerCase ().contains(searchSubstring) }
311
+ .filter { it.lowercase ().contains(searchSubstring) }
312
312
.flatMap {
313
313
FilenameIndex .getVirtualFilesByName(it, GlobalSearchScope .projectScope(project))
314
314
}
@@ -319,12 +319,10 @@ class FindFilesByNameSubstring : AbstractMcpTool<Query>() {
319
319
} catch (e: IllegalArgumentException ) {
320
320
false
321
321
}
322
- }
323
- .map { file ->
322
+ }.joinToString(" ,\n " , prefix = " [" , postfix = " ]" ) { file ->
324
323
val relativePath = projectDir.relativize(Path (file.path)).toString()
325
324
""" {"path": "$relativePath ", "name": "${file.name} "}"""
326
325
}
327
- .joinToString(" ,\n " , prefix = " [" , postfix = " ]" )
328
326
)
329
327
}
330
328
}
You can’t perform that action at this time.
0 commit comments