[FIR IDE] Fix callableIdIfNonLocal in AAPI/FE10
Before, implementations of 'callableIdIfNonLocal' in Fe10KtSymbols returned CallableIds even for local declarations. This commit fixes this behavior. This commit fixes KtFe10SymbolByPsiTestGenerated.testLocalDeclarations().
This commit is contained in:
+3
-2
@@ -13,7 +13,8 @@ import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.KtF
|
|||||||
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.KtFe10DescPropertyGetterSymbol
|
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.KtFe10DescPropertyGetterSymbol
|
||||||
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.KtFe10DescPropertySetterSymbol
|
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.KtFe10DescPropertySetterSymbol
|
||||||
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.KtFe10DescValueParameterSymbol
|
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.KtFe10DescValueParameterSymbol
|
||||||
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.base.callableId
|
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.base.calculateCallableId
|
||||||
|
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.base.callableIdIfNotLocal
|
||||||
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.base.toKtCallableSymbol
|
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.base.toKtCallableSymbol
|
||||||
import org.jetbrains.kotlin.analysis.api.diagnostics.KtNonBoundToPsiErrorDiagnostic
|
import org.jetbrains.kotlin.analysis.api.diagnostics.KtNonBoundToPsiErrorDiagnostic
|
||||||
import org.jetbrains.kotlin.analysis.api.impl.base.components.AbstractKtCallResolver
|
import org.jetbrains.kotlin.analysis.api.impl.base.components.AbstractKtCallResolver
|
||||||
@@ -141,7 +142,7 @@ internal class KtFe10CallResolver(
|
|||||||
val variableSymbol = variableDescriptor.toKtCallableSymbol(analysisContext) as? KtVariableLikeSymbol ?: return null
|
val variableSymbol = variableDescriptor.toKtCallableSymbol(analysisContext) as? KtVariableLikeSymbol ?: return null
|
||||||
|
|
||||||
val substitutor = KtSubstitutor.Empty(token)
|
val substitutor = KtSubstitutor.Empty(token)
|
||||||
return if (resolvedCall.functionCall.resultingDescriptor.callableId in kotlinFunctionInvokeCallableIds) {
|
return if (resolvedCall.functionCall.resultingDescriptor.callableIdIfNotLocal in kotlinFunctionInvokeCallableIds) {
|
||||||
KtFunctionalTypeVariableCall(variableSymbol, argumentMapping, getTarget(callableSymbol), substitutor, token)
|
KtFunctionalTypeVariableCall(variableSymbol, argumentMapping, getTarget(callableSymbol), substitutor, token)
|
||||||
} else {
|
} else {
|
||||||
KtVariableWithInvokeFunctionCall(variableSymbol, argumentMapping, getTarget(callableSymbol), substitutor, token)
|
KtVariableWithInvokeFunctionCall(variableSymbol, argumentMapping, getTarget(callableSymbol), substitutor, token)
|
||||||
|
|||||||
+2
-2
@@ -55,8 +55,8 @@ internal class KtFe10DescConstructorSymbol(
|
|||||||
return pointerByPsi
|
return pointerByPsi
|
||||||
}
|
}
|
||||||
|
|
||||||
val callableId = descriptor.callableId
|
val callableId = descriptor.callableIdIfNotLocal
|
||||||
if (callableId != null && !callableId.isLocal) {
|
if (callableId != null) {
|
||||||
val signature = descriptor.getSymbolPointerSignature(analysisContext)
|
val signature = descriptor.getSymbolPointerSignature(analysisContext)
|
||||||
return KtFe10DescFunctionLikeSymbolPointer(callableId, signature)
|
return KtFe10DescFunctionLikeSymbolPointer(callableId, signature)
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -64,7 +64,7 @@ internal class KtFe10DescFunctionSymbol(
|
|||||||
get() = withValidityAssertion { descriptor.ktHasStableParameterNames }
|
get() = withValidityAssertion { descriptor.ktHasStableParameterNames }
|
||||||
|
|
||||||
override val callableIdIfNonLocal: CallableId?
|
override val callableIdIfNonLocal: CallableId?
|
||||||
get() = withValidityAssertion { descriptor.callableId }
|
get() = withValidityAssertion { descriptor.callableIdIfNotLocal }
|
||||||
|
|
||||||
override val annotatedType: KtTypeAndAnnotations
|
override val annotatedType: KtTypeAndAnnotations
|
||||||
get() = withValidityAssertion { descriptor.returnTypeOrNothing.toKtTypeAndAnnotations(analysisContext) }
|
get() = withValidityAssertion { descriptor.returnTypeOrNothing.toKtTypeAndAnnotations(analysisContext) }
|
||||||
@@ -87,8 +87,8 @@ internal class KtFe10DescFunctionSymbol(
|
|||||||
return pointerByPsi
|
return pointerByPsi
|
||||||
}
|
}
|
||||||
|
|
||||||
val callableId = descriptor.callableId
|
val callableId = descriptor.callableIdIfNotLocal
|
||||||
if (callableId != null && !callableId.isLocal) {
|
if (callableId != null) {
|
||||||
val signature = descriptor.getSymbolPointerSignature(analysisContext)
|
val signature = descriptor.getSymbolPointerSignature(analysisContext)
|
||||||
return KtFe10DescFunctionLikeSymbolPointer(callableId, signature)
|
return KtFe10DescFunctionLikeSymbolPointer(callableId, signature)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -7,7 +7,7 @@ package org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased
|
|||||||
|
|
||||||
import org.jetbrains.kotlin.analysis.api.descriptors.Fe10AnalysisContext
|
import org.jetbrains.kotlin.analysis.api.descriptors.Fe10AnalysisContext
|
||||||
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.base.KtFe10DescMemberSymbol
|
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.base.KtFe10DescMemberSymbol
|
||||||
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.base.callableId
|
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.base.callableIdIfNotLocal
|
||||||
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.base.toKtTypeAndAnnotations
|
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.base.toKtTypeAndAnnotations
|
||||||
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.pointers.KtFe10NeverRestoringSymbolPointer
|
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.pointers.KtFe10NeverRestoringSymbolPointer
|
||||||
import org.jetbrains.kotlin.analysis.api.symbols.KtJavaFieldSymbol
|
import org.jetbrains.kotlin.analysis.api.symbols.KtJavaFieldSymbol
|
||||||
@@ -34,7 +34,7 @@ internal class KtFe10DescJavaFieldSymbol(
|
|||||||
get() = withValidityAssertion { !descriptor.isVar }
|
get() = withValidityAssertion { !descriptor.isVar }
|
||||||
|
|
||||||
override val callableIdIfNonLocal: CallableId?
|
override val callableIdIfNonLocal: CallableId?
|
||||||
get() = withValidityAssertion { descriptor.callableId }
|
get() = withValidityAssertion { descriptor.callableIdIfNotLocal }
|
||||||
|
|
||||||
override val annotatedType: KtTypeAndAnnotations
|
override val annotatedType: KtTypeAndAnnotations
|
||||||
get() = withValidityAssertion { descriptor.returnType.toKtTypeAndAnnotations(analysisContext) }
|
get() = withValidityAssertion { descriptor.returnType.toKtTypeAndAnnotations(analysisContext) }
|
||||||
|
|||||||
+1
-1
@@ -64,7 +64,7 @@ internal class KtFe10DescKotlinPropertySymbol(
|
|||||||
get() = withValidityAssertion { descriptor.setter != null }
|
get() = withValidityAssertion { descriptor.setter != null }
|
||||||
|
|
||||||
override val callableIdIfNonLocal: CallableId?
|
override val callableIdIfNonLocal: CallableId?
|
||||||
get() = withValidityAssertion { descriptor.callableId }
|
get() = withValidityAssertion { descriptor.callableIdIfNotLocal }
|
||||||
|
|
||||||
override val initializer: KtConstantValue?
|
override val initializer: KtConstantValue?
|
||||||
get() = withValidityAssertion { descriptor.compileTimeInitializer?.toKtConstantValue() }
|
get() = withValidityAssertion { descriptor.compileTimeInitializer?.toKtConstantValue() }
|
||||||
|
|||||||
+1
-1
@@ -47,7 +47,7 @@ internal class KtFe10DescPropertyGetterSymbol(
|
|||||||
get() = withValidityAssertion {
|
get() = withValidityAssertion {
|
||||||
val propertyDescriptor = descriptor.correspondingProperty
|
val propertyDescriptor = descriptor.correspondingProperty
|
||||||
return if (propertyDescriptor is SyntheticPropertyDescriptor) {
|
return if (propertyDescriptor is SyntheticPropertyDescriptor) {
|
||||||
propertyDescriptor.getMethod.callableId
|
propertyDescriptor.getMethod.callableIdIfNotLocal
|
||||||
} else {
|
} else {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -50,7 +50,7 @@ internal class KtFe10DescPropertySetterSymbol(
|
|||||||
get() = withValidityAssertion {
|
get() = withValidityAssertion {
|
||||||
val propertyDescriptor = descriptor.correspondingProperty
|
val propertyDescriptor = descriptor.correspondingProperty
|
||||||
return if (propertyDescriptor is SyntheticPropertyDescriptor) {
|
return if (propertyDescriptor is SyntheticPropertyDescriptor) {
|
||||||
propertyDescriptor.getMethod.callableId
|
propertyDescriptor.getMethod.callableIdIfNotLocal
|
||||||
} else {
|
} else {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -36,7 +36,7 @@ internal class KtFe10DescSamConstructorSymbol(
|
|||||||
get() = withValidityAssertion { descriptor.ktHasStableParameterNames }
|
get() = withValidityAssertion { descriptor.ktHasStableParameterNames }
|
||||||
|
|
||||||
override val callableIdIfNonLocal: CallableId?
|
override val callableIdIfNonLocal: CallableId?
|
||||||
get() = withValidityAssertion { descriptor.callableId }
|
get() = withValidityAssertion { descriptor.callableIdIfNotLocal }
|
||||||
|
|
||||||
override val annotatedType: KtTypeAndAnnotations
|
override val annotatedType: KtTypeAndAnnotations
|
||||||
get() = withValidityAssertion { descriptor.returnTypeOrNothing.toKtTypeAndAnnotations(analysisContext) }
|
get() = withValidityAssertion { descriptor.returnTypeOrNothing.toKtTypeAndAnnotations(analysisContext) }
|
||||||
|
|||||||
+1
-1
@@ -78,7 +78,7 @@ internal class KtFe10DescSyntheticJavaPropertySymbol(
|
|||||||
get() = withValidityAssertion { descriptor.compileTimeInitializer?.toKtConstantValue() }
|
get() = withValidityAssertion { descriptor.compileTimeInitializer?.toKtConstantValue() }
|
||||||
|
|
||||||
override val callableIdIfNonLocal: CallableId?
|
override val callableIdIfNonLocal: CallableId?
|
||||||
get() = withValidityAssertion { descriptor.callableId }
|
get() = withValidityAssertion { descriptor.callableIdIfNotLocal }
|
||||||
|
|
||||||
override val annotatedType: KtTypeAndAnnotations
|
override val annotatedType: KtTypeAndAnnotations
|
||||||
get() = withValidityAssertion { descriptor.type.toKtTypeAndAnnotations(analysisContext) }
|
get() = withValidityAssertion { descriptor.type.toKtTypeAndAnnotations(analysisContext) }
|
||||||
|
|||||||
+1
-1
@@ -78,7 +78,7 @@ internal class KtFe10DescSyntheticJavaPropertySymbolForOverride(
|
|||||||
get() = withValidityAssertion { descriptor.compileTimeInitializer?.toKtConstantValue() }
|
get() = withValidityAssertion { descriptor.compileTimeInitializer?.toKtConstantValue() }
|
||||||
|
|
||||||
override val callableIdIfNonLocal: CallableId?
|
override val callableIdIfNonLocal: CallableId?
|
||||||
get() = withValidityAssertion { descriptor.callableId }
|
get() = withValidityAssertion { descriptor.callableIdIfNotLocal }
|
||||||
|
|
||||||
override val annotatedType: KtTypeAndAnnotations
|
override val annotatedType: KtTypeAndAnnotations
|
||||||
get() = withValidityAssertion { descriptor.type.toKtTypeAndAnnotations(analysisContext) }
|
get() = withValidityAssertion { descriptor.type.toKtTypeAndAnnotations(analysisContext) }
|
||||||
|
|||||||
+27
-19
@@ -235,31 +235,39 @@ internal fun ConstantValue<*>.toKtConstantValue(): KtConstantValue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal val CallableMemberDescriptor.callableId: CallableId?
|
internal val CallableMemberDescriptor.callableIdIfNotLocal: CallableId?
|
||||||
get() {
|
get() = calculateCallableId(allowLocal = false)
|
||||||
var current: DeclarationDescriptor = containingDeclaration
|
|
||||||
|
|
||||||
val localName = mutableListOf<String>()
|
internal fun CallableMemberDescriptor.calculateCallableId(allowLocal: Boolean): CallableId? {
|
||||||
val className = mutableListOf<String>()
|
var current: DeclarationDescriptor = containingDeclaration
|
||||||
|
|
||||||
while (true) {
|
val localName = mutableListOf<String>()
|
||||||
when (current) {
|
val className = mutableListOf<String>()
|
||||||
is PackageFragmentDescriptor -> {
|
|
||||||
return CallableId(
|
while (true) {
|
||||||
packageName = current.fqName,
|
when (current) {
|
||||||
className = if (className.isNotEmpty()) FqName.fromSegments(className.asReversed()) else null,
|
is PackageFragmentDescriptor -> {
|
||||||
callableName = name,
|
return CallableId(
|
||||||
pathToLocal = if (localName.isNotEmpty()) FqName.fromSegments(localName.asReversed()) else null
|
packageName = current.fqName,
|
||||||
)
|
className = if (className.isNotEmpty()) FqName.fromSegments(className.asReversed()) else null,
|
||||||
}
|
callableName = name,
|
||||||
is ClassDescriptor -> className += current.name.asString()
|
pathToLocal = if (localName.isNotEmpty()) FqName.fromSegments(localName.asReversed()) else null
|
||||||
is PropertyAccessorDescriptor -> {} // Filter out property accessors
|
)
|
||||||
is CallableDescriptor -> localName += current.name.asString()
|
|
||||||
}
|
}
|
||||||
|
is ClassDescriptor -> className += current.name.asString()
|
||||||
|
is PropertyAccessorDescriptor -> {} // Filter out property accessors
|
||||||
|
is CallableDescriptor -> {
|
||||||
|
if (!allowLocal) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
current = current.containingDeclaration ?: return null
|
localName += current.name.asString()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
current = current.containingDeclaration ?: return null
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
internal fun getSymbolDescriptor(symbol: KtSymbol): DeclarationDescriptor? {
|
internal fun getSymbolDescriptor(symbol: KtSymbol): DeclarationDescriptor? {
|
||||||
return when (symbol) {
|
return when (symbol) {
|
||||||
|
|||||||
+2
-2
@@ -11,7 +11,7 @@ import org.jetbrains.kotlin.analysis.api.descriptors.KtFe10AnalysisSession
|
|||||||
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.base.toKtTypeAndAnnotations
|
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.base.toKtTypeAndAnnotations
|
||||||
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.pointers.KtFe10NeverRestoringSymbolPointer
|
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.pointers.KtFe10NeverRestoringSymbolPointer
|
||||||
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.psiBased.base.KtFe10PsiSymbol
|
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.psiBased.base.KtFe10PsiSymbol
|
||||||
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.psiBased.base.callableId
|
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.psiBased.base.callableIdIfNonLocal
|
||||||
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.psiBased.base.createErrorTypeAndAnnotations
|
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.psiBased.base.createErrorTypeAndAnnotations
|
||||||
import org.jetbrains.kotlin.analysis.api.descriptors.utils.cached
|
import org.jetbrains.kotlin.analysis.api.descriptors.utils.cached
|
||||||
import org.jetbrains.kotlin.analysis.api.symbols.KtEnumEntrySymbol
|
import org.jetbrains.kotlin.analysis.api.symbols.KtEnumEntrySymbol
|
||||||
@@ -44,7 +44,7 @@ internal class KtFe10PsiEnumEntrySymbol(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override val callableIdIfNonLocal: CallableId?
|
override val callableIdIfNonLocal: CallableId?
|
||||||
get() = withValidityAssertion { psi.callableId }
|
get() = withValidityAssertion { psi.callableIdIfNonLocal }
|
||||||
|
|
||||||
override val annotatedType: KtTypeAndAnnotations
|
override val annotatedType: KtTypeAndAnnotations
|
||||||
get() = withValidityAssertion {
|
get() = withValidityAssertion {
|
||||||
|
|||||||
+1
-1
@@ -73,7 +73,7 @@ internal class KtFe10PsiFunctionSymbol(
|
|||||||
get() = withValidityAssertion { true }
|
get() = withValidityAssertion { true }
|
||||||
|
|
||||||
override val callableIdIfNonLocal: CallableId?
|
override val callableIdIfNonLocal: CallableId?
|
||||||
get() = withValidityAssertion { psi.callableId }
|
get() = withValidityAssertion { psi.callableIdIfNonLocal }
|
||||||
|
|
||||||
override val annotatedType: KtTypeAndAnnotations
|
override val annotatedType: KtTypeAndAnnotations
|
||||||
get() = withValidityAssertion { descriptor?.returnType?.toKtTypeAndAnnotations(analysisContext) ?: createErrorTypeAndAnnotations() }
|
get() = withValidityAssertion { descriptor?.returnType?.toKtTypeAndAnnotations(analysisContext) ?: createErrorTypeAndAnnotations() }
|
||||||
|
|||||||
+1
-1
@@ -96,7 +96,7 @@ internal class KtFe10PsiKotlinPropertySymbol(
|
|||||||
get() = withValidityAssertion { !psi.isVar }
|
get() = withValidityAssertion { !psi.isVar }
|
||||||
|
|
||||||
override val callableIdIfNonLocal: CallableId?
|
override val callableIdIfNonLocal: CallableId?
|
||||||
get() = withValidityAssertion { psi.callableId }
|
get() = withValidityAssertion { psi.callableIdIfNonLocal }
|
||||||
|
|
||||||
override val annotatedType: KtTypeAndAnnotations
|
override val annotatedType: KtTypeAndAnnotations
|
||||||
get() = withValidityAssertion { descriptor?.type?.toKtTypeAndAnnotations(analysisContext) ?: createErrorTypeAndAnnotations() }
|
get() = withValidityAssertion { descriptor?.type?.toKtTypeAndAnnotations(analysisContext) ?: createErrorTypeAndAnnotations() }
|
||||||
|
|||||||
+1
-1
@@ -64,7 +64,7 @@ internal class KtFe10PsiPropertyGetterSymbol(
|
|||||||
get() = withValidityAssertion { true }
|
get() = withValidityAssertion { true }
|
||||||
|
|
||||||
override val callableIdIfNonLocal: CallableId?
|
override val callableIdIfNonLocal: CallableId?
|
||||||
get() = withValidityAssertion { psi.property.callableId }
|
get() = withValidityAssertion { psi.property.callableIdIfNonLocal }
|
||||||
|
|
||||||
override val annotatedType: KtTypeAndAnnotations
|
override val annotatedType: KtTypeAndAnnotations
|
||||||
get() = withValidityAssertion {
|
get() = withValidityAssertion {
|
||||||
|
|||||||
+31
-20
@@ -68,34 +68,45 @@ internal val KtElement.ktSymbolKind: KtSymbolKind
|
|||||||
else -> KtSymbolKind.LOCAL
|
else -> KtSymbolKind.LOCAL
|
||||||
}
|
}
|
||||||
|
|
||||||
internal val KtDeclaration.callableId: CallableId?
|
internal val KtDeclaration.callableIdIfNonLocal: CallableId?
|
||||||
get() {
|
get() = calculateCallableId(allowLocal = false)
|
||||||
val selfName = this.name ?: return null
|
|
||||||
val containingFile = this.containingKtFile
|
|
||||||
|
|
||||||
var current = this.getElementParentDeclaration()
|
internal fun KtDeclaration.calculateCallableId(allowLocal: Boolean): CallableId? {
|
||||||
|
val selfName = this.name ?: return null
|
||||||
|
val containingFile = this.containingKtFile
|
||||||
|
|
||||||
val localName = mutableListOf<String>()
|
var current = this.getElementParentDeclaration()
|
||||||
val className = mutableListOf<String>()
|
|
||||||
|
|
||||||
while (current != null) {
|
val localName = mutableListOf<String>()
|
||||||
when (current) {
|
val className = mutableListOf<String>()
|
||||||
is KtClassOrObject -> className += current.name ?: return null
|
|
||||||
is KtPropertyAccessor -> {} // Filter out property accessors
|
while (current != null) {
|
||||||
is KtCallableDeclaration -> localName += current.name ?: return null
|
when (current) {
|
||||||
|
is KtClassOrObject -> {
|
||||||
|
className += current.name ?: return null
|
||||||
|
}
|
||||||
|
is KtPropertyAccessor -> {
|
||||||
|
// Filter out property accessors
|
||||||
|
}
|
||||||
|
is KtCallableDeclaration -> {
|
||||||
|
if (!allowLocal) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
localName += current.name ?: return null
|
||||||
}
|
}
|
||||||
|
|
||||||
current = current.getElementParentDeclaration()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return CallableId(
|
current = current.getElementParentDeclaration()
|
||||||
packageName = containingFile.packageFqName,
|
|
||||||
className = if (className.isNotEmpty()) FqName.fromSegments(className.asReversed()) else null,
|
|
||||||
callableName = Name.identifier(selfName),
|
|
||||||
pathToLocal = if (localName.isNotEmpty()) FqName.fromSegments(localName.asReversed()) else null
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return CallableId(
|
||||||
|
packageName = containingFile.packageFqName,
|
||||||
|
className = if (className.isNotEmpty()) FqName.fromSegments(className.asReversed()) else null,
|
||||||
|
callableName = Name.identifier(selfName),
|
||||||
|
pathToLocal = if (localName.isNotEmpty()) FqName.fromSegments(localName.asReversed()) else null
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
internal fun PsiElement.getResolutionScope(bindingContext: BindingContext): LexicalScope? {
|
internal fun PsiElement.getResolutionScope(bindingContext: BindingContext): LexicalScope? {
|
||||||
for (parent in parentsWithSelf) {
|
for (parent in parentsWithSelf) {
|
||||||
if (parent is KtElement) {
|
if (parent is KtElement) {
|
||||||
|
|||||||
Reference in New Issue
Block a user