Skip to content

Commit 9340b61

Browse files
committed
emit overridden_symbols for methods (and fix filter conditioin)
1 parent 1987d46 commit 9340b61

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

semanticdb-kotlinc/src/main/kotlin/com/sourcegraph/semanticdb_kotlinc/SemanticdbTextDocumentBuilder.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import org.jetbrains.kotlin.com.intellij.psi.PsiElement
1616
import org.jetbrains.kotlin.descriptors.ClassDescriptor
1717
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
1818
import org.jetbrains.kotlin.descriptors.DeclarationDescriptorWithSource
19+
import org.jetbrains.kotlin.descriptors.SimpleFunctionDescriptor
1920
import org.jetbrains.kotlin.idea.KotlinLanguage
2021
import org.jetbrains.kotlin.ir.backend.js.lower.serialization.ir.JsManglerDesc.fqnString
2122
import org.jetbrains.kotlin.psi.KtConstructor
@@ -66,10 +67,14 @@ class SemanticdbTextDocumentBuilder(
6667
.getAllSuperClassifiers()
6768
// first is the class itself
6869
.drop(1)
69-
.filter { it.fqnString == "kotlin.Any" || it.fqnString == "java.lang.Object" }
70+
.filter {
71+
it.fqnString != "kotlin.Any" && it.fqnString != "java.lang.Object"
72+
}
7073
.flatMap { cache[it] }
7174
.map { it.toString() }
7275
.asIterable()
76+
is SimpleFunctionDescriptor ->
77+
descriptor.overriddenDescriptors.flatMap { cache[it] }.map { it.toString() }
7378
else -> emptyList<String>().asIterable()
7479
}
7580
return SymbolInformation {

0 commit comments

Comments
 (0)