We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
toNioPathOrNull
1 parent 7de0aff commit f147ca9Copy full SHA for f147ca9
src/main/kotlin/cc/unitmesh/devti/embedding/SemanticService.kt
@@ -12,7 +12,6 @@ import com.intellij.openapi.project.Project
12
import com.intellij.openapi.project.guessProjectDir
13
import com.intellij.openapi.util.io.FileUtilRt
14
import com.intellij.openapi.vfs.VirtualFile
15
-import com.intellij.openapi.vfs.toNioPathOrNull
16
import kotlinx.coroutines.*
17
import java.io.File
18
import java.nio.file.Path
@@ -128,4 +127,8 @@ fun VirtualFile.canBeAdded(): Boolean {
128
127
if (this.fileType.isBinary || FileUtilRt.isTooLarge(this.length)) return false
129
130
return true
131
-}
+}
+
132
+fun VirtualFile.toNioPathOrNull(): Path? {
133
+ return runCatching { toNioPath() }.getOrNull()
134
0 commit comments