Ahmed na
02/06/2023, 11:30 PMKSClassDeclaration
for type ClassKind.ENUM_CLASS
is it possible to get the names of the enums ?Jiaxiang
02/06/2023, 11:37 PMKSClassDeclaration.declarations
, you should get a list of declarations inside the enum class, and you can filter instances of ClassKind.ENUM_ENTRY
to get the enum entries.Ahmed na
02/06/2023, 11:48 PMfun KSClassDeclaration.getEnumEntries(): Sequence<KSDeclaration> {
return declarations.filter { it.closestClassDeclaration()?.classKind == ClassKind.ENUM_ENTRY }
}