[Analysis API] KtPsiTypeProvider: disable for non-jvm platforms
Otherwise, it will throw exception like: ``` IllegalStateException: No 'FirJvmTypeMapper' ``` Anyway, PsiType is JVM conception, so it is not supposed to be used outside the JVM platform ^KT-60318
This commit is contained in:
committed by
Space Team
parent
7fa7d8ea8d
commit
7a24d0ee82
+5
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@@ -24,6 +24,8 @@ import org.jetbrains.kotlin.load.kotlin.TypeMappingMode
|
||||
import org.jetbrains.kotlin.load.kotlin.getOptimalModeForReturnType
|
||||
import org.jetbrains.kotlin.load.kotlin.getOptimalModeForValueParameter
|
||||
import org.jetbrains.kotlin.name.SpecialNames
|
||||
import org.jetbrains.kotlin.platform.has
|
||||
import org.jetbrains.kotlin.platform.jvm.JvmPlatform
|
||||
import org.jetbrains.kotlin.types.*
|
||||
import org.jetbrains.kotlin.types.model.SimpleTypeMarker
|
||||
import java.text.StringCharacterIterator
|
||||
@@ -51,6 +53,8 @@ internal class KtFe10PsiTypeProvider(
|
||||
}
|
||||
}
|
||||
|
||||
if (!analysisSession.useSiteModule.platform.has<JvmPlatform>()) return null
|
||||
|
||||
return asPsiTypeElement(simplifyType(kotlinType), useSitePosition, mode.toTypeMappingMode(type, isAnnotationMethod))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user