Don't show KDoc references in Call Hierarchy
^KT-39558 Fixed
This commit is contained in:
@@ -25,6 +25,7 @@ import org.jetbrains.kotlin.idea.findUsages.KotlinClassFindUsagesOptions
|
||||
import org.jetbrains.kotlin.idea.findUsages.KotlinFunctionFindUsagesOptions
|
||||
import org.jetbrains.kotlin.idea.findUsages.KotlinPropertyFindUsagesOptions
|
||||
import org.jetbrains.kotlin.idea.findUsages.processAllUsages
|
||||
import org.jetbrains.kotlin.kdoc.psi.api.KDoc
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.psi.psiUtil.containingClassOrObject
|
||||
import org.jetbrains.kotlin.psi.psiUtil.getNonStrictParentOfType
|
||||
@@ -98,7 +99,8 @@ class KotlinCallerTreeStructure(
|
||||
// If reference belongs to property initializer, show enclosing declaration instead
|
||||
elementToSearch.processAllUsages(findOptions) {
|
||||
val refElement = it.element
|
||||
if (refElement != null && !JavaResolveUtil.isInJavaDoc(refElement)) {
|
||||
val isInKDoc = PsiTreeUtil.getParentOfType(refElement, KDoc::class.java) != null
|
||||
if (refElement != null && !JavaResolveUtil.isInJavaDoc(refElement) && !isInKDoc) {
|
||||
processReference(it.reference, refElement, nodeDescriptor, callerToDescriptorMap, false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
<node text="K.persist() ()" base="true">
|
||||
</node>
|
||||
@@ -0,0 +1,12 @@
|
||||
open class K {
|
||||
public fun <caret>persist() {}
|
||||
}
|
||||
|
||||
class Foo : K() {
|
||||
/**
|
||||
* [persist]
|
||||
*/
|
||||
fun foo() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -319,6 +319,11 @@ public class HierarchyTestGenerated extends AbstractHierarchyTest {
|
||||
runTest("idea/testData/hierarchy/calls/callers/insideJavadoc/");
|
||||
}
|
||||
|
||||
@TestMetadata("insideKDoc")
|
||||
public void testInsideKDoc() throws Exception {
|
||||
runTest("idea/testData/hierarchy/calls/callers/insideKDoc/");
|
||||
}
|
||||
|
||||
@TestMetadata("kotlinClass")
|
||||
public void testKotlinClass() throws Exception {
|
||||
runTest("idea/testData/hierarchy/calls/callers/kotlinClass/");
|
||||
|
||||
Reference in New Issue
Block a user