[LL API] Support nested type aliases in file-based declaration provider
This commit is contained in:
+1
-2
@@ -65,8 +65,7 @@ internal class FileBasedKotlinDeclarationProvider(private val kotlinFile: KtFile
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun getAllTypeAliasesByClassId(classId: ClassId): Collection<KtTypeAlias> {
|
override fun getAllTypeAliasesByClassId(classId: ClassId): Collection<KtTypeAlias> {
|
||||||
val name = classId.relativeClassName.pathSegments().singleOrNull() ?: return emptyList()
|
return getClassLikeDeclarationsByClassId(classId).filterIsInstance<KtTypeAlias>().toList()
|
||||||
return getTopLevelDeclarations(classId.packageFqName, name)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getTopLevelKotlinClassLikeDeclarationNamesInPackage(packageFqName: FqName): Set<Name> {
|
override fun getTopLevelKotlinClassLikeDeclarationNamesInPackage(packageFqName: FqName): Set<Name> {
|
||||||
|
|||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
// TYPE_ALIAS: test/Foo.Bar
|
||||||
|
|
||||||
|
package test
|
||||||
|
|
||||||
|
class Foo {
|
||||||
|
typealias Bar = Foo
|
||||||
|
}
|
||||||
+6
@@ -36,6 +36,12 @@ public class FileBasedKotlinDeclarationProviderTestGenerated extends AbstractFil
|
|||||||
runTest("analysis/low-level-api-fir/testdata/fileBasedDeclarationProvider/local.kt");
|
runTest("analysis/low-level-api-fir/testdata/fileBasedDeclarationProvider/local.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("nestedTypeAlias.kt")
|
||||||
|
public void testNestedTypeAlias() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/fileBasedDeclarationProvider/nestedTypeAlias.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("sameNames.kt")
|
@TestMetadata("sameNames.kt")
|
||||||
public void testSameNames() throws Exception {
|
public void testSameNames() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user