in src/main/kotlin/com/jetbrains/plugin/jtreg/listeners/FileHandlers.kt [77:97]
fun processFileClosed(project: Project, rootManager: TestRootManager, testInfo: TestInfo) {
ApplicationManager.getApplication().executeOnPooledThread {
val file = testInfo.file
val isJtregTestData = runReadAction { JTRegLibUtils.isTestData(project, file) }
if (!file.exists() || isJtregTestData) {
if (project.isOpen) {
val rootModel = runReadAction { rootManager.rootModel(testInfo, project) }
rootModel?.use {
val rootsToRemove = if (file.exists()) runReadAction {
return@runReadAction JTRegLibUtils.getTestRoots(project, file)
} else testInfo.roots
rootModel.removeSourceFolders(rootsToRemove)
testInfo.jtregLib?.let {
rootModel.removeLibrary(it)
testInfo.jtregLib = null
}
}
}
}
}
}