Filter synthetic trait overrides for "overriding" markers too

This commit is contained in:
Nikolay Krasko
2014-08-14 14:29:34 +04:00
committed by Nikolay Krasko
parent 897ebd0347
commit 236cdc7d82
5 changed files with 42 additions and 6 deletions
@@ -477,12 +477,14 @@ public class JetLineMarkerProvider implements LineMarkerProvider {
public boolean process(Pair<PsiMethod, PsiMethod> pair) {
ProgressManager.checkCanceled();
PsiMethod superMethod = pair.getFirst();
if (!(pair.getSecond() instanceof KotlinLightMethodFromTrait)) {
PsiMethod superMethod = pair.getFirst();
T declaration = mappingToJava.get(superMethod);
if (declaration != null) {
mappingToJava.remove(superMethod);
overridden.add(declaration);
T declaration = mappingToJava.get(superMethod);
if (declaration != null) {
mappingToJava.remove(superMethod);
overridden.add(declaration);
}
}
return !mappingToJava.isEmpty();
@@ -0,0 +1,9 @@
trait <lineMarker descr="*"></lineMarker>SkipSupport {
fun <lineMarker descr="<html><body>Is implemented in <br>&nbsp;&nbsp;&nbsp;&nbsp;SkipSupportWithDefaults</body></html>"></lineMarker>skip()
}
public trait <lineMarker descr="*"></lineMarker>SkipSupportWithDefaults : SkipSupport {
override fun <lineMarker descr="Implements function in 'SkipSupport'"></lineMarker>skip() {}
}
open class SkipSupportImpl : SkipSupportWithDefaults
@@ -0,0 +1,13 @@
trait <lineMarker descr="*"></lineMarker>SkipSupport {
fun <lineMarker descr="<html><body>Is implemented in <br>&nbsp;&nbsp;&nbsp;&nbsp;SkipSupportImpl1<br>&nbsp;&nbsp;&nbsp;&nbsp;SkipSupportWithDefaults</body></html>"></lineMarker>skip()
}
public trait <lineMarker descr="*"></lineMarker>SkipSupportWithDefaults : SkipSupport {
override fun <lineMarker descr="<html><body>Is implemented in <br>&nbsp;&nbsp;&nbsp;&nbsp;SkipSupportImpl1</body></html>"><lineMarker descr="Implements function in 'SkipSupport'"></lineMarker></lineMarker>skip() {}
}
public trait SkipSupportImpl1 : SkipSupportWithDefaults {
override fun <lineMarker descr="Overrides function in 'SkipSupportWithDefaults'"></lineMarker>skip() {}
}
open class SkipSupportImpl : SkipSupportWithDefaults
@@ -75,7 +75,7 @@ public abstract class AbstractLineMarkersTest extends JetLightCodeInsightFixture
}
catch (AssertionError error) {
try {
String actualTextWithTestData = HighlightTestDataUtil.insertInfoTags(markers, false, myFixture.getFile().getText());
String actualTextWithTestData = HighlightTestDataUtil.insertInfoTags(markers, true, myFixture.getFile().getText());
JetTestUtils.assertEqualsToFile(new File(getTestDataPath(), fileName()), actualTextWithTestData);
}
catch (FileComparisonFailure failure) {
@@ -104,6 +104,12 @@ public class LineMarkersTestGenerated extends AbstractLineMarkersTest {
doTest(fileName);
}
@TestMetadata("NoOverridingMarkerOnDefaultTraitImpl.kt")
public void testNoOverridingMarkerOnDefaultTraitImpl() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/lineMarker/NoOverridingMarkerOnDefaultTraitImpl.kt");
doTest(fileName);
}
@TestMetadata("Overloads.kt")
public void testOverloads() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/lineMarker/Overloads.kt");
@@ -122,6 +128,12 @@ public class LineMarkersTestGenerated extends AbstractLineMarkersTest {
doTest(fileName);
}
@TestMetadata("OverridingTooltipOnDefaultTraitImpl.kt")
public void testOverridingTooltipOnDefaultTraitImpl() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/lineMarker/OverridingTooltipOnDefaultTraitImpl.kt");
doTest(fileName);
}
@TestMetadata("PropertyOverride.kt")
public void testPropertyOverride() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/lineMarker/PropertyOverride.kt");