mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[kotlin] KTIJ-34551 - Fixed property references not suggesting nested class properties
^KTIJ-34551 fixed GitOrigin-RevId: f0da2a5e590fc640965aca80345b7285b78665c0
This commit is contained in:
committed by
intellij-monorepo-bot
parent
eb4a67e77a
commit
7a4bd42074
+6
-1
@@ -122,7 +122,12 @@ fun collectReceiverTypesForElement(callElement: KtElement, explicitReceiver: KtE
|
||||
|
||||
context(KaSession)
|
||||
fun collectReceiverTypesForExplicitReceiverExpression(explicitReceiver: KtExpression): List<KaType> {
|
||||
explicitReceiver.referenceExpression()?.mainReference?.let { receiverReference ->
|
||||
val referenceExpression = when (explicitReceiver) {
|
||||
is KtDotQualifiedExpression -> explicitReceiver.selectorExpression ?: explicitReceiver
|
||||
else -> explicitReceiver
|
||||
}
|
||||
|
||||
referenceExpression.referenceExpression()?.mainReference?.let { receiverReference ->
|
||||
val receiverSymbol = receiverReference.resolveToExpandedSymbol()
|
||||
if (receiverSymbol == null || receiverSymbol is KaPackageSymbol) return emptyList()
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
class Test {
|
||||
val outerVal: Int = 5
|
||||
data class Data (
|
||||
val innerVal: String
|
||||
) {
|
||||
fun innerFun() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun main() {
|
||||
Test.Data::<caret>
|
||||
}
|
||||
|
||||
// EXIST: innerVal
|
||||
// EXIST: { "itemText": "innerFun", "tailText": "()" }
|
||||
// ABSENT: outerVal
|
||||
+5
@@ -655,6 +655,11 @@ public abstract class K1JSBasicCompletionTestGenerated extends AbstractK1JSBasic
|
||||
runTest("../testData/basic/common/callableReference/JavaSyntheticPropertyReferenceTrueNegative3.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("NestedClass.kt")
|
||||
public void testNestedClass() throws Exception {
|
||||
runTest("../testData/basic/common/callableReference/NestedClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("NonEmptyQualifier.kt")
|
||||
public void testNonEmptyQualifier() throws Exception {
|
||||
runTest("../testData/basic/common/callableReference/NonEmptyQualifier.kt");
|
||||
|
||||
+5
@@ -655,6 +655,11 @@ public abstract class K1JvmBasicCompletionTestGenerated extends AbstractK1JvmBas
|
||||
runTest("../testData/basic/common/callableReference/JavaSyntheticPropertyReferenceTrueNegative3.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("NestedClass.kt")
|
||||
public void testNestedClass() throws Exception {
|
||||
runTest("../testData/basic/common/callableReference/NestedClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("NonEmptyQualifier.kt")
|
||||
public void testNonEmptyQualifier() throws Exception {
|
||||
runTest("../testData/basic/common/callableReference/NonEmptyQualifier.kt");
|
||||
|
||||
+5
@@ -655,6 +655,11 @@ public abstract class K1MLPerformanceCompletionTestGenerated extends AbstractK1M
|
||||
runTest("../testData/basic/common/callableReference/JavaSyntheticPropertyReferenceTrueNegative3.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("NestedClass.kt")
|
||||
public void testNestedClass() throws Exception {
|
||||
runTest("../testData/basic/common/callableReference/NestedClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("NonEmptyQualifier.kt")
|
||||
public void testNonEmptyQualifier() throws Exception {
|
||||
runTest("../testData/basic/common/callableReference/NonEmptyQualifier.kt");
|
||||
|
||||
+5
@@ -655,6 +655,11 @@ public abstract class K2JsBasicCompletionLegacyStdlibTestGenerated extends Abstr
|
||||
runTest("../../completion/testData/basic/common/callableReference/JavaSyntheticPropertyReferenceTrueNegative3.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("NestedClass.kt")
|
||||
public void testNestedClass() throws Exception {
|
||||
runTest("../../completion/testData/basic/common/callableReference/NestedClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("NonEmptyQualifier.kt")
|
||||
public void testNonEmptyQualifier() throws Exception {
|
||||
runTest("../../completion/testData/basic/common/callableReference/NonEmptyQualifier.kt");
|
||||
|
||||
+5
@@ -655,6 +655,11 @@ public abstract class K2JvmBasicCompletionTestGenerated extends AbstractK2JvmBas
|
||||
runTest("../../completion/testData/basic/common/callableReference/JavaSyntheticPropertyReferenceTrueNegative3.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("NestedClass.kt")
|
||||
public void testNestedClass() throws Exception {
|
||||
runTest("../../completion/testData/basic/common/callableReference/NestedClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("NonEmptyQualifier.kt")
|
||||
public void testNonEmptyQualifier() throws Exception {
|
||||
runTest("../../completion/testData/basic/common/callableReference/NonEmptyQualifier.kt");
|
||||
|
||||
+5
@@ -684,6 +684,11 @@ public abstract class CommonNativeJvmKotlinKmpCompletionTestGenerated extends Ab
|
||||
runTest("../../completion/testData/basic/common/callableReference/JavaSyntheticPropertyReferenceTrueNegative3.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("NestedClass.kt")
|
||||
public void testNestedClass() throws Exception {
|
||||
runTest("../../completion/testData/basic/common/callableReference/NestedClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("NonEmptyQualifier.kt")
|
||||
public void testNonEmptyQualifier() throws Exception {
|
||||
runTest("../../completion/testData/basic/common/callableReference/NonEmptyQualifier.kt");
|
||||
|
||||
+5
@@ -684,6 +684,11 @@ public abstract class JsKotlinKmpCompletionTestGenerated extends AbstractKotlinK
|
||||
runTest("../../completion/testData/basic/common/callableReference/JavaSyntheticPropertyReferenceTrueNegative3.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("NestedClass.kt")
|
||||
public void testNestedClass() throws Exception {
|
||||
runTest("../../completion/testData/basic/common/callableReference/NestedClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("NonEmptyQualifier.kt")
|
||||
public void testNonEmptyQualifier() throws Exception {
|
||||
runTest("../../completion/testData/basic/common/callableReference/NonEmptyQualifier.kt");
|
||||
|
||||
+5
@@ -684,6 +684,11 @@ public abstract class NativeLinuxKotlinKmpCompletionTestGenerated extends Abstra
|
||||
runTest("../../completion/testData/basic/common/callableReference/JavaSyntheticPropertyReferenceTrueNegative3.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("NestedClass.kt")
|
||||
public void testNestedClass() throws Exception {
|
||||
runTest("../../completion/testData/basic/common/callableReference/NestedClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("NonEmptyQualifier.kt")
|
||||
public void testNonEmptyQualifier() throws Exception {
|
||||
runTest("../../completion/testData/basic/common/callableReference/NonEmptyQualifier.kt");
|
||||
|
||||
Reference in New Issue
Block a user