Wrap file.declarations with runReadAction
#EA-209932 Fixed
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.backend.common
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.backend.common.bridges.findInterfaceImplementation
|
||||
@@ -171,10 +172,12 @@ object CodegenUtil {
|
||||
* Returns functions, properties and type aliases in the given [file] which should be generated by the back-end.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun getMemberDeclarationsToGenerate(file: KtFile): List<KtDeclaration> =
|
||||
file.declarations.filter { declaration ->
|
||||
fun getMemberDeclarationsToGenerate(file: KtFile): List<KtDeclaration> {
|
||||
val declarations = ApplicationManager.getApplication().runReadAction<List<KtDeclaration>> { file.declarations }
|
||||
return declarations.filter { declaration ->
|
||||
!declaration.hasExpectModifier() && (declaration is KtNamedFunction || declaration is KtProperty || declaration is KtTypeAlias)
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getMemberDescriptorsToGenerate(file: KtFile, bindingContext: BindingContext): List<MemberDescriptor> =
|
||||
|
||||
Reference in New Issue
Block a user