FIR IDE: allow getting light class name from EDT
This commit is contained in:
+1
-1
@@ -120,7 +120,7 @@ internal abstract class FirLightClassForClassOrObjectSymbol(
|
||||
|
||||
abstract override fun hashCode(): Int
|
||||
|
||||
override fun getName(): String? = classOrObjectSymbol.name.asString()
|
||||
override fun getName(): String? = allowLightClassesOnEdt { classOrObjectSymbol.name.asString() }
|
||||
|
||||
override fun hasModifierProperty(@NonNls name: String): Boolean = modifierList?.hasModifierProperty(name) ?: false
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Copyright 2010-2020 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.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.idea.asJava
|
||||
|
||||
import org.jetbrains.kotlin.idea.frontend.api.HackToForceAllowRunningAnalyzeOnEDT
|
||||
import org.jetbrains.kotlin.idea.frontend.api.hackyAllowRunningOnEdt
|
||||
|
||||
@OptIn(HackToForceAllowRunningAnalyzeOnEDT::class)
|
||||
internal inline fun <E> allowLightClassesOnEdt(action: () -> E): E = hackyAllowRunningOnEdt(action)
|
||||
Reference in New Issue
Block a user