Skip to content

Commit

Permalink
Fix SlowOperations
Browse files Browse the repository at this point in the history
  • Loading branch information
alex999990009 committed Jun 25, 2024
1 parent 783e712 commit 3833869
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/kotlin/org/arend/util/VirtualFileUtils.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.arend.util

import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.vfs.JarFileSystem
import com.intellij.openapi.vfs.VfsUtil
import com.intellij.openapi.vfs.VirtualFile
Expand Down Expand Up @@ -42,7 +43,13 @@ fun VirtualFile.getRelativeFile(path: Collection<String>, ext: String = "", crea

val VirtualFile.configFile: VirtualFile?
get() = when {
isDirectory -> findChild(FileUtils.LIBRARY_CONFIG_FILE)
isDirectory -> {
var configFile: VirtualFile? = null
ApplicationManager.getApplication().executeOnPooledThread {
configFile = findChild(FileUtils.LIBRARY_CONFIG_FILE)
}.get()
configFile
}
name == FileUtils.LIBRARY_CONFIG_FILE -> this
name.endsWith(FileUtils.ZIP_EXTENSION) -> JarFileSystem.getInstance().getJarRootForLocalFile(this)?.findChild(FileUtils.LIBRARY_CONFIG_FILE)
else -> null
Expand Down

0 comments on commit 3833869

Please sign in to comment.