KT-17689: Fix TypeAliasQualifier to provide enum entries descriptors
- this adds enum entries to the completion on the typealiases - we cannot use `unsubstitutedInnerClassesScope` instead of `EnumEntriesScope` because it allows to complete things that are not allowed to be resolved by the Kotlin compiler; see `EnumEntriesScope` doc for details - ^KT-17689 Fixed
This commit is contained in:
committed by
Roman Golyshev
parent
f419d2eb30
commit
9a938b07ba
+14
@@ -0,0 +1,14 @@
|
||||
enum class A {
|
||||
ONE;
|
||||
class B // Not allowed to resolve through typealiases
|
||||
}
|
||||
|
||||
typealias AA = A
|
||||
typealias AAA = AA
|
||||
|
||||
fun usage() {
|
||||
AAA.<caret>
|
||||
}
|
||||
|
||||
// EXIST: ONE
|
||||
// ABSENT: B
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
enum class A {
|
||||
ONE;
|
||||
class B // Not allowed to resolve through typealiases
|
||||
}
|
||||
|
||||
typealias AA = A
|
||||
|
||||
fun usage() {
|
||||
AA.<caret>
|
||||
}
|
||||
|
||||
// EXIST: ONE, values, valueOf
|
||||
// ABSENT: B
|
||||
+10
@@ -101,6 +101,16 @@ public class JSBasicCompletionTestGenerated extends AbstractJSBasicCompletionTes
|
||||
runTest("idea/idea-completion/testData/basic/common/DataClassMembers2.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("EnumItemsThroughChainedTypeAlias.kt")
|
||||
public void testEnumItemsThroughChainedTypeAlias() throws Exception {
|
||||
runTest("idea/idea-completion/testData/basic/common/EnumItemsThroughChainedTypeAlias.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("EnumItemsThroughSingleTypeAlias.kt")
|
||||
public void testEnumItemsThroughSingleTypeAlias() throws Exception {
|
||||
runTest("idea/idea-completion/testData/basic/common/EnumItemsThroughSingleTypeAlias.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ExtendClassName.kt")
|
||||
public void testExtendClassName() throws Exception {
|
||||
runTest("idea/idea-completion/testData/basic/common/ExtendClassName.kt");
|
||||
|
||||
+10
@@ -101,6 +101,16 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT
|
||||
runTest("idea/idea-completion/testData/basic/common/DataClassMembers2.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("EnumItemsThroughChainedTypeAlias.kt")
|
||||
public void testEnumItemsThroughChainedTypeAlias() throws Exception {
|
||||
runTest("idea/idea-completion/testData/basic/common/EnumItemsThroughChainedTypeAlias.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("EnumItemsThroughSingleTypeAlias.kt")
|
||||
public void testEnumItemsThroughSingleTypeAlias() throws Exception {
|
||||
runTest("idea/idea-completion/testData/basic/common/EnumItemsThroughSingleTypeAlias.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ExtendClassName.kt")
|
||||
public void testExtendClassName() throws Exception {
|
||||
runTest("idea/idea-completion/testData/basic/common/ExtendClassName.kt");
|
||||
|
||||
Reference in New Issue
Block a user