[CHERRY PICKED FROM IJ] Trigger face change event to address facet change save
GitOrigin-RevId: 952c9e6f3270f75d6a293e71d33f958e24ff3c2a Original commit: https://github.com/JetBrains/intellij-community/commit/18c931145f22fd69826e480bfe596e75ec05bab0
This commit is contained in:
committed by
Nikita Bobko
parent
5d0c87e402
commit
f701cdcc97
@@ -107,8 +107,7 @@ private fun readV1Config(element: Element): KotlinFacetSettings {
|
||||
// TODO: Introduce new version of facet serialization. See https://youtrack.jetbrains.com/issue/KT-38235
|
||||
// This is necessary to avoid having too much custom logic for platform serialization.
|
||||
fun Element.getFacetPlatformByConfigurationElement(): TargetPlatform {
|
||||
val targetPlatform = getAttributeValue("allPlatforms").deserializeTargetPlatformByComponentPlatforms()
|
||||
if (targetPlatform != null) return targetPlatform
|
||||
getAttributeValue("allPlatforms").deserializeTargetPlatformByComponentPlatforms()?.let { return it }
|
||||
|
||||
// failed to read list of all platforms. Fallback to legacy algorithm
|
||||
val platformName = getAttributeValue("platform") ?: return DefaultIdeTargetPlatformKindProvider.defaultPlatform
|
||||
@@ -422,9 +421,7 @@ private fun TargetPlatform.serializeComponentPlatforms(): String {
|
||||
}
|
||||
|
||||
private fun String?.deserializeTargetPlatformByComponentPlatforms(): TargetPlatform? {
|
||||
val componentPlatformNames = this?.split('/')?.toSet()
|
||||
if (componentPlatformNames == null || componentPlatformNames.isEmpty())
|
||||
return null
|
||||
val componentPlatformNames = this?.split('/')?.toSet()?.takeIf { it.isNotEmpty() } ?: return null
|
||||
|
||||
val knownComponentPlatforms = HashMap<String, SimplePlatform>() // "serialization presentation" to "simple platform name"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user