FIR: Fix bug with incorrect source element for qualifiers
This commit is contained in:
Generated
+5
@@ -144,6 +144,11 @@ public class FirReferenceResolveTestGenerated extends AbstractFirReferenceResolv
|
||||
runTest("idea/testData/resolve/references/EnumValues.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ExternalCompanionObject.kt")
|
||||
public void testExternalCompanionObject() throws Exception {
|
||||
runTest("idea/testData/resolve/references/ExternalCompanionObject.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("FakeJavaLang1.kt")
|
||||
public void testFakeJavaLang1() throws Exception {
|
||||
runTest("idea/testData/resolve/references/FakeJavaLang1.kt");
|
||||
|
||||
+2
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.idea.references
|
||||
|
||||
import com.intellij.psi.tree.TokenSet
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.ROOT_PREFIX_FOR_IDE_RESOLUTION_MODE
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.declarations.synthetic.FirSyntheticProperty
|
||||
import org.jetbrains.kotlin.fir.expressions.*
|
||||
@@ -121,6 +122,7 @@ internal object FirReferenceResolveHelper {
|
||||
else -> {
|
||||
qualified
|
||||
.collectDescendantsOfType<KtSimpleNameExpression>()
|
||||
.dropWhile { it.getReferencedName() == ROOT_PREFIX_FOR_IDE_RESOLUTION_MODE }
|
||||
.joinToString(separator = ".") { it.getReferencedName() }
|
||||
.let(::FqName)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
package dependency
|
||||
|
||||
class C {
|
||||
companion object
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
fun usage() {
|
||||
dependency.C.<caret>Companion
|
||||
}
|
||||
|
||||
// REF: companion object of (dependency).C
|
||||
+5
@@ -144,6 +144,11 @@ public class ReferenceResolveTestGenerated extends AbstractReferenceResolveTest
|
||||
runTest("idea/testData/resolve/references/EnumValues.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ExternalCompanionObject.kt")
|
||||
public void testExternalCompanionObject() throws Exception {
|
||||
runTest("idea/testData/resolve/references/ExternalCompanionObject.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("FakeJavaLang1.kt")
|
||||
public void testFakeJavaLang1() throws Exception {
|
||||
runTest("idea/testData/resolve/references/FakeJavaLang1.kt");
|
||||
|
||||
Reference in New Issue
Block a user