Test for "KT-3769 Find usages gives no result for overrides"
#KT-3769 Obsolete
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
* Copyright 2010-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -165,6 +165,10 @@ public class JetRefactoringUtil {
|
||||
@NotNull List<String> superClasses,
|
||||
@NotNull String actionStringKey
|
||||
) {
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
return ContainerUtil.newArrayList(overriddenElementsToDescriptor.keySet());
|
||||
}
|
||||
|
||||
String superClassesStr = "\n" + StringUtil.join(superClasses, "");
|
||||
String message = JetBundle.message(
|
||||
"x.overrides.y.in.class.list",
|
||||
@@ -174,9 +178,7 @@ public class JetRefactoringUtil {
|
||||
JetBundle.message(actionStringKey)
|
||||
);
|
||||
|
||||
int exitCode = Messages.showYesNoCancelDialog(
|
||||
declaration.getProject(), message, IdeBundle.message("title.warning"), Messages.getQuestionIcon()
|
||||
);
|
||||
int exitCode = Messages.showYesNoCancelDialog(declaration.getProject(), message, IdeBundle.message("title.warning"), Messages.getQuestionIcon());
|
||||
switch (exitCode) {
|
||||
case Messages.YES:
|
||||
return ContainerUtil.newArrayList(overriddenElementsToDescriptor.keySet());
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetNamedFunction
|
||||
// OPTIONS: usages, skipImports
|
||||
|
||||
trait A {
|
||||
fun foo()
|
||||
}
|
||||
|
||||
class B: A {
|
||||
override fun <caret>foo() {} // Find usages gives no results
|
||||
}
|
||||
|
||||
fun main(a: A) {
|
||||
a.foo()
|
||||
}
|
||||
|
||||
// for KT-3769 Find usages gives no result for overrides
|
||||
@@ -0,0 +1 @@
|
||||
Function call (13: 7) a.foo()
|
||||
@@ -343,6 +343,11 @@ public class JetFindUsagesTestGenerated extends AbstractJetFindUsagesTest {
|
||||
doTest("idea/testData/findUsages/kotlin/findFunctionUsages/kotlinTopLevelMethodUsagesNoImport.0.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("usagesOfBaseForFunction.0.kt")
|
||||
public void testUsagesOfBaseForFunction() throws Exception {
|
||||
doTest("idea/testData/findUsages/kotlin/findFunctionUsages/usagesOfBaseForFunction.0.kt");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@TestMetadata("idea/testData/findUsages/kotlin/findObjectUsages")
|
||||
|
||||
Reference in New Issue
Block a user