Wrap KtClassOrObject.isLocal, KtFile.isScript with runReadAction in LightClasses
#EA-211576 Fixed (cherry picked from commit 75a59d4bced714af51abd7e354bc873313b28051)
This commit is contained in:
+3
-4
@@ -129,7 +129,7 @@ class IDELightClassGenerationSupport(private val project: Project) : LightClassG
|
||||
override fun createUltraLightClass(element: KtClassOrObject): KtUltraLightClass? {
|
||||
if (element.shouldNotBeVisibleAsLightClass() ||
|
||||
element is KtEnumEntry ||
|
||||
element.containingKtFile.isScript()
|
||||
element.containingKtFile.safeIsScript()
|
||||
) {
|
||||
return null
|
||||
}
|
||||
@@ -139,7 +139,7 @@ class IDELightClassGenerationSupport(private val project: Project) : LightClassG
|
||||
element is KtObjectDeclaration && element.isObjectLiteral() ->
|
||||
KtUltraLightClassForAnonymousDeclaration(element, support)
|
||||
|
||||
element.isLocal ->
|
||||
element.safeIsLocal() ->
|
||||
KtUltraLightClassForLocalDeclaration(element, support)
|
||||
|
||||
(element.hasModifier(KtTokens.INLINE_KEYWORD)) ->
|
||||
@@ -219,5 +219,4 @@ class IDELightClassGenerationSupport(private val project: Project) : LightClassG
|
||||
override fun analyze(element: KtElement) = element.analyze(BodyResolveMode.PARTIAL)
|
||||
|
||||
override fun analyzeWithContent(element: KtClassOrObject) = element.analyzeWithContent()
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user