Do not show non-actual members in actual gutter #KT-27951 Fixed
This commit is contained in:
@@ -86,7 +86,7 @@ fun ModuleDescriptor.actualsFor(descriptor: MemberDescriptor, checkCompatible: B
|
||||
} else {
|
||||
descriptor.findAnyActualForExpected(this@actualsFor)
|
||||
}
|
||||
}
|
||||
}.filter { (it as? MemberDescriptor)?.isEffectivelyActual() == true }
|
||||
|
||||
private fun DeclarationDescriptor.actualsForExpected(): Collection<DeclarationDescriptor> {
|
||||
if (this is MemberDescriptor) {
|
||||
@@ -129,9 +129,11 @@ fun KtDeclaration.isEffectivelyActual(): Boolean {
|
||||
if (hasActualModifier()) return true
|
||||
|
||||
val descriptor = toDescriptor() as? MemberDescriptor ?: return false
|
||||
return descriptor.isActual || descriptor.isEnumEntryInActual()
|
||||
return descriptor.isEffectivelyActual()
|
||||
}
|
||||
|
||||
private fun MemberDescriptor.isEffectivelyActual() = isActual || isEnumEntryInActual()
|
||||
|
||||
private fun MemberDescriptor.isEnumEntryInActual() =
|
||||
(DescriptorUtils.isEnumEntry(this) && (containingDeclaration as? MemberDescriptor)?.isActual == true)
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
// !CHECK_HIGHLIGHTING
|
||||
|
||||
expect fun some()
|
||||
@@ -0,0 +1,3 @@
|
||||
actual fun doAnother(s: String) {}
|
||||
|
||||
fun doAnother(s: String, i: Int) {}
|
||||
@@ -0,0 +1,5 @@
|
||||
expect fun doSomething(s: String)
|
||||
|
||||
fun doSomething(s: String, i: Int) {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
// !CHECK_HIGHLIGHTING
|
||||
|
||||
fun main(args: Array<String>) {}
|
||||
Generated
+10
@@ -45,6 +45,11 @@ public class MultiModuleLineMarkerTestGenerated extends AbstractMultiModuleLineM
|
||||
runTest("idea/testData/multiModuleLineMarker/actualEnumEntriesInOneLine/");
|
||||
}
|
||||
|
||||
@TestMetadata("actualWithOverload")
|
||||
public void testActualWithOverload() throws Exception {
|
||||
runTest("idea/testData/multiModuleLineMarker/actualWithOverload/");
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInMultiModuleLineMarker() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/multiModuleLineMarker"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, false);
|
||||
}
|
||||
@@ -64,6 +69,11 @@ public class MultiModuleLineMarkerTestGenerated extends AbstractMultiModuleLineM
|
||||
runTest("idea/testData/multiModuleLineMarker/expectEnumEntriesInOneLine/");
|
||||
}
|
||||
|
||||
@TestMetadata("expectWithOverload")
|
||||
public void testExpectWithOverload() throws Exception {
|
||||
runTest("idea/testData/multiModuleLineMarker/expectWithOverload/");
|
||||
}
|
||||
|
||||
@TestMetadata("fromActualAnnotation")
|
||||
public void testFromActualAnnotation() throws Exception {
|
||||
runTest("idea/testData/multiModuleLineMarker/fromActualAnnotation/");
|
||||
|
||||
Reference in New Issue
Block a user