File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
exts/ext-git/src/main/kotlin/cc/unitmesh/git/mcp Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -3,15 +3,15 @@ package cc.unitmesh.git.mcp
33import cc.unitmesh.devti.mcp.host.AbstractMcpTool
44import cc.unitmesh.devti.mcp.host.NoArgs
55import cc.unitmesh.devti.mcp.host.Response
6- import com.intellij.compiler.cache.git.GitCommitsIterator
76import com.intellij.openapi.project.Project
87import com.intellij.openapi.project.guessProjectDir
98import com.intellij.openapi.vcs.ProjectLevelVcsManager
109import com.intellij.openapi.vcs.changes.ChangeListManager
11- import com.intellij.openapi.vfs.toNioPathOrNull
10+ import com.intellij.openapi.vfs.VirtualFile
1211import git4idea.history.GitHistoryUtils
1312import git4idea.repo.GitRepositoryManager
1413import kotlinx.serialization.Serializable
14+ import java.nio.file.Path
1515import kotlin.io.path.Path
1616
1717@Serializable
@@ -105,4 +105,8 @@ class GetVcsStatusTool : AbstractMcpTool<NoArgs>() {
105105 """ {"path": "${it.first} ", "type": "${it.second} "}"""
106106 })
107107 }
108- }
108+ }
109+
110+ fun VirtualFile.toNioPathOrNull (): Path ? {
111+ return runCatching { toNioPath() }.getOrNull()
112+ }
You can’t perform that action at this time.
0 commit comments