[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> {
|
||||
val name = classId.relativeClassName.pathSegments().singleOrNull() ?: return emptyList()
|
||||
return getTopLevelDeclarations(classId.packageFqName, name)
|
||||
return getClassLikeDeclarationsByClassId(classId).filterIsInstance<KtTypeAlias>().toList()
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nestedTypeAlias.kt")
|
||||
public void testNestedTypeAlias() throws Exception {
|
||||
runTest("analysis/low-level-api-fir/testdata/fileBasedDeclarationProvider/nestedTypeAlias.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("sameNames.kt")
|
||||
public void testSameNames() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user