Multiplatform Project: Fix impl-by-header search and vice versa
This commit is contained in:
@@ -50,14 +50,7 @@ fun ModuleDescriptor.hasDeclarationOf(descriptor: MemberDescriptor) = declaratio
|
||||
|
||||
private fun ModuleDescriptor.declarationOf(descriptor: MemberDescriptor): DeclarationDescriptor? =
|
||||
with (HeaderImplDeclarationChecker(this)) {
|
||||
when (descriptor) {
|
||||
is CallableMemberDescriptor ->
|
||||
descriptor.findNamesakesFromTheSameModule().filter { it.isHeader }.firstOrNull()
|
||||
is ClassifierDescriptorWithTypeParameters ->
|
||||
descriptor.findClassifiersFromTheSameModule().filter { it is ClassDescriptor && it.isHeader }.firstOrNull()
|
||||
else ->
|
||||
null
|
||||
}
|
||||
descriptor.findCompatibleDescriptors().firstOrNull { it.isHeader }
|
||||
}
|
||||
|
||||
fun getHeaderDeclarationTooltip(declaration: KtDeclaration): String? {
|
||||
@@ -87,4 +80,4 @@ internal fun KtDeclaration.liftToHeader(): KtDeclaration? {
|
||||
hasModifier(KtTokens.IMPL_KEYWORD) -> headerDeclarationIfAny()
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,11 +33,7 @@ fun ModuleDescriptor.hasImplementationsOf(descriptor: MemberDescriptor) =
|
||||
|
||||
private fun ModuleDescriptor.implementationsOf(descriptor: MemberDescriptor): List<DeclarationDescriptor> =
|
||||
with (HeaderImplDeclarationChecker(this)) {
|
||||
when (descriptor) {
|
||||
is CallableMemberDescriptor -> descriptor.findNamesakesFromTheSameModule().filter { it.isImpl }
|
||||
is ClassDescriptor -> descriptor.findClassifiersFromTheSameModule().filter { it.isImpl }
|
||||
else -> emptyList()
|
||||
}
|
||||
descriptor.findCompatibleDescriptors().filter { it.isImpl }
|
||||
}
|
||||
|
||||
fun getPlatformImplementationTooltip(declaration: KtDeclaration): String? {
|
||||
|
||||
Reference in New Issue
Block a user