Supported usages as doc-comments

This commit is contained in:
Valentin Kipyatkov
2016-08-25 21:27:46 +03:00
parent 696f382291
commit d13cdc67f0
3 changed files with 8 additions and 2 deletions
@@ -42,6 +42,7 @@ import org.jetbrains.kotlin.idea.search.unionSafe
import org.jetbrains.kotlin.idea.util.FuzzyType
import org.jetbrains.kotlin.idea.util.fuzzyExtensionReceiverType
import org.jetbrains.kotlin.idea.util.toFuzzyType
import org.jetbrains.kotlin.kdoc.psi.impl.KDocName
import org.jetbrains.kotlin.psi.*
import org.jetbrains.kotlin.psi.psiUtil.*
import org.jetbrains.kotlin.resolve.dataClassUtils.getComponentIndex
@@ -179,7 +180,6 @@ private class Processor(
private fun processKotlinDataClassUsage(element: PsiElement): Boolean {
//TODO: type aliases
//TODO: doc-comments
when (element) {
is KtReferenceExpression -> {
@@ -242,6 +242,8 @@ private class Processor(
if (element.getStrictParentOfType<KtImportDirective>() != null) return true // ignore usage in import
}
is KDocName -> return true // ignore usage in doc-comment
}
return false // unsupported type of reference
@@ -8,6 +8,10 @@ fun A.ext1() {
val (x, y) = getThis()
}
/**
* Doc-comment reference 1: [A]
* Doc-comment reference 2: [ext1]
*/
fun List<A>.ext1() {
val (x, y) = get(0)
}
@@ -1,4 +1,4 @@
[dataClass.0.kt] Value read 12 val (x, y) = get(0)
[dataClass.0.kt] Value read 16 val (x, y) = get(0)
[dataClass.0.kt] Value read 8 val (x, y) = getThis()
[dataClass.1.kt] Value read 4 for ((x, y, z) in arrayOf<A>()) {
[dataClass.1.kt] Value read 8 val (x, y) = a