[AA] fe10 symbols adjusted to be used in goto type declaration
- try to find sources for decompiled symbols in IDE mode - function literals can't be declared as extensions, though there target can contain that indication, let's take what descriptor provides
This commit is contained in:
+6
-1
@@ -14,6 +14,7 @@ import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
|||||||
import org.jetbrains.kotlin.descriptors.DeclarationDescriptorWithSource
|
import org.jetbrains.kotlin.descriptors.DeclarationDescriptorWithSource
|
||||||
import org.jetbrains.kotlin.descriptors.SourceElement
|
import org.jetbrains.kotlin.descriptors.SourceElement
|
||||||
import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
||||||
|
import org.jetbrains.kotlin.references.fe10.base.KtFe10ReferenceResolutionHelper
|
||||||
import org.jetbrains.kotlin.resolve.source.PsiSourceElement
|
import org.jetbrains.kotlin.resolve.source.PsiSourceElement
|
||||||
|
|
||||||
internal interface KtFe10DescSymbol<T : DeclarationDescriptor> : KtFe10Symbol, KtFe10AnnotatedSymbol {
|
internal interface KtFe10DescSymbol<T : DeclarationDescriptor> : KtFe10Symbol, KtFe10AnnotatedSymbol {
|
||||||
@@ -28,7 +29,11 @@ internal interface KtFe10DescSymbol<T : DeclarationDescriptor> : KtFe10Symbol, K
|
|||||||
}
|
}
|
||||||
|
|
||||||
override val psi: PsiElement?
|
override val psi: PsiElement?
|
||||||
get() = withValidityAssertion { (source as? PsiSourceElement)?.psi }
|
get() = withValidityAssertion {
|
||||||
|
(source as? PsiSourceElement)?.psi
|
||||||
|
?: KtFe10ReferenceResolutionHelper.getInstance()
|
||||||
|
?.findDecompiledDeclaration(analysisContext.resolveSession.project, descriptor, null)
|
||||||
|
}
|
||||||
|
|
||||||
override val origin: KtSymbolOrigin
|
override val origin: KtSymbolOrigin
|
||||||
get() = withValidityAssertion { descriptor.getSymbolOrigin(analysisContext) }
|
get() = withValidityAssertion { descriptor.getSymbolOrigin(analysisContext) }
|
||||||
|
|||||||
-4
@@ -59,10 +59,6 @@ internal class KtFe10PsiLiteralAnonymousFunctionSymbol(
|
|||||||
|
|
||||||
override val receiverParameter: KtReceiverParameterSymbol?
|
override val receiverParameter: KtReceiverParameterSymbol?
|
||||||
get() = withValidityAssertion {
|
get() = withValidityAssertion {
|
||||||
if (!psi.isExtensionDeclaration()) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
descriptor?.extensionReceiverParameter?.toKtReceiverParameterSymbol(analysisContext)
|
descriptor?.extensionReceiverParameter?.toKtReceiverParameterSymbol(analysisContext)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user