(LightClasses) resolve of annotations fast-path

This commit is contained in:
Vladimir Ilmov
2020-06-05 01:35:41 +02:00
parent 991f12bd73
commit 3634cbe3cb
3 changed files with 8 additions and 1 deletions
@@ -66,7 +66,7 @@ class IDELightClassGenerationSupport(private val project: Project) : LightClassG
it.shortName == fqName.shortName() || owner.containingKtFile.hasAlias(it.shortName)
}
for (entry in candidates) {
val descriptor = analyze(entry).get(BindingContext.ANNOTATION, entry)
val descriptor = analyzeAnnotation(entry)
if (descriptor?.fqName == fqName) {
return Pair(entry, descriptor)
}
@@ -218,5 +218,7 @@ class IDELightClassGenerationSupport(private val project: Project) : LightClassG
override fun analyze(element: KtElement) = element.analyze(BodyResolveMode.PARTIAL)
override fun analyzeAnnotation(element: KtAnnotationEntry): AnnotationDescriptor? = element.resolveToDescriptorIfAny()
override fun analyzeWithContent(element: KtClassOrObject) = element.analyzeWithContent()
}