mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
KTIJ-31273 [kotlin] Cleanup KtCompilerPluginsProviderIdeImpl
Use common `isKotlinFacet` utility to check for Kotlin facets GitOrigin-RevId: 60983d171573cc6caa19ee05fa7a7b91ad5600c7
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b7b31955b5
commit
43007f90f2
+3
-9
@@ -48,7 +48,7 @@ import org.jetbrains.kotlin.idea.base.util.caching.getChanges
|
||||
import org.jetbrains.kotlin.idea.compiler.configuration.KotlinCommonCompilerArgumentsHolder
|
||||
import org.jetbrains.kotlin.idea.compiler.configuration.KotlinCompilerSettingsListener
|
||||
import org.jetbrains.kotlin.idea.facet.KotlinFacet
|
||||
import org.jetbrains.kotlin.idea.facet.KotlinFacetType
|
||||
import org.jetbrains.kotlin.idea.facet.isKotlinFacet
|
||||
import org.jetbrains.kotlin.util.ServiceLoaderLite
|
||||
import java.io.File
|
||||
import java.nio.file.Path
|
||||
@@ -74,7 +74,8 @@ internal class KtCompilerPluginsProviderIdeImpl(
|
||||
cs.launch {
|
||||
WorkspaceModel.getInstance(project).eventLog.collect { event ->
|
||||
val hasChanges = event.getChanges<FacetEntity>().any { change ->
|
||||
change.facetTypes.any { it == KotlinFacetType.ID }
|
||||
val entities = listOfNotNull(change.oldEntity, change.newEntity)
|
||||
entities.any { it.isKotlinFacet() }
|
||||
}
|
||||
if (hasChanges) {
|
||||
resetPluginsCache()
|
||||
@@ -100,13 +101,6 @@ internal class KtCompilerPluginsProviderIdeImpl(
|
||||
)
|
||||
}
|
||||
|
||||
private val EntityChange<FacetEntity>.facetTypes: List<String>
|
||||
get() = when (this) {
|
||||
is EntityChange.Added -> listOf(newEntity.typeId.name)
|
||||
is EntityChange.Removed -> listOf(oldEntity.typeId.name)
|
||||
is EntityChange.Replaced -> listOf(oldEntity.typeId.name, newEntity.typeId.name)
|
||||
}
|
||||
|
||||
private fun createNewCache(): PluginsCache? {
|
||||
if (!project.isTrusted()) return null
|
||||
val pluginsClassLoader: UrlClassLoader = UrlClassLoader.build().apply {
|
||||
|
||||
Reference in New Issue
Block a user