[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:
Dmitriy Novozhilov
2021-11-15 12:57:26 +03:00
committed by teamcityserver
parent 40d8451698
commit cb0705ec03
25 changed files with 388 additions and 228 deletions
@@ -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)
}
}