UAST: Fall back to JVM platform if element doesn't have a module
This commit is contained in:
@@ -66,8 +66,9 @@ class KotlinUastLanguagePlugin : UastLanguagePlugin {
|
|||||||
private val PsiElement.isJvmElement
|
private val PsiElement.isJvmElement
|
||||||
get() = try {
|
get() = try {
|
||||||
// Workaround for UAST used without full-fledged IDEA when ProjectFileIndex is not available
|
// Workaround for UAST used without full-fledged IDEA when ProjectFileIndex is not available
|
||||||
// If we can't get the module, act as if the current platform is JVM
|
// If we can't get the module (or don't have one), act as if the current platform is JVM
|
||||||
module?.let { TargetPlatformDetector.getPlatform(it) } is JvmPlatform
|
val module = module
|
||||||
|
module == null || TargetPlatformDetector.getPlatform(module) is JvmPlatform
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user