feat: [EXPERIMENTAL] prune method bodies of files before parsing in JavaCompilerImpl

This commit is contained in:
Akash Yadav
2023-02-23 23:22:23 +05:30
parent 3d606d16b4
commit 4ebda7fc8f
9 changed files with 196 additions and 51 deletions
@@ -35,6 +35,8 @@ import java.time.Instant
import org.apache.commons.io.FileUtils
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode.BACKGROUND
import java.net.URI
import java.nio.file.Paths
/**
* Manages active documents.
@@ -46,6 +48,10 @@ object FileManager : EventReceiver {
private val log = ILogger.newInstance(javaClass.simpleName)
private val activeDocuments: MutableMap<Path, ActiveDocument> = mutableMapOf()
fun isActive(uri: URI): Boolean {
return isActive(Paths.get(uri))
}
fun isActive(file: Path): Boolean {
return this.activeDocuments.containsKey(file.normalize())
}