[FIR] Change scheme of generating declarations by plugins
Methods `needToGenerateAdditionalMembersInClass` and `needToGenerateNestedClassifiersInClass` are removed, now compiler uses `get...Names` and `getTopLevel...` methods to determine which extension may generate declaration with specific classId/callableId This is needed to simplify API of FirDeclarationGenerationExtension and provide guarantee that `generate...` method will be called with specific classId/callableId only if specific extensions returned name for this id from `getName...` functions
This commit is contained in:
committed by
teamcityserver
parent
40d8451698
commit
cb0705ec03
@@ -75,3 +75,11 @@ fun <V> FqName.findValueForMostSpecificFqname(values: Map<FqName, V>): V? {
|
||||
|
||||
return suitableItems.minByOrNull { (fqName, _) -> fqName.tail(this).asString().length }?.value
|
||||
}
|
||||
|
||||
fun ClassId.callableIdForConstructor(): CallableId {
|
||||
return if (isNestedClass) {
|
||||
CallableId(outerClassId!!, shortClassName)
|
||||
} else {
|
||||
CallableId(packageFqName, shortClassName)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user