Refactor module usages in HeaderImplDeclarationChecker
Instead of a vague name "moduleToCheck", use explicit names "commonModule" and "platformModule".
This commit is contained in:
+4
-3
@@ -54,7 +54,6 @@ class PlatformHeaderAnnotator : Annotator {
|
||||
val descriptor = declaration.toDescriptor() as? MemberDescriptor ?: return Diagnostics.EMPTY
|
||||
if (!descriptor.isHeader) return Diagnostics.EMPTY
|
||||
|
||||
val checkers = modulesToCheck.map(::HeaderImplDeclarationChecker)
|
||||
val diagnosticList = mutableListOf<Diagnostic>()
|
||||
val diagnosticSink = object : DiagnosticSink {
|
||||
override fun report(diagnostic: Diagnostic) {
|
||||
@@ -63,8 +62,10 @@ class PlatformHeaderAnnotator : Annotator {
|
||||
|
||||
override fun wantsDiagnostics() = true
|
||||
}
|
||||
for (checker in checkers) {
|
||||
checker.checkHeaderDeclarationHasImplementation(declaration, descriptor, diagnosticSink, checkImpl = false)
|
||||
for (module in modulesToCheck) {
|
||||
HeaderImplDeclarationChecker.checkHeaderDeclarationHasImplementation(
|
||||
declaration, descriptor, diagnosticSink, module, checkImpl = false
|
||||
)
|
||||
}
|
||||
|
||||
val suppressionCache = KotlinCacheService.getInstance(declaration.project).getSuppressionCache()
|
||||
|
||||
@@ -51,8 +51,8 @@ private enum class SourceKind { NONE, PRODUCTION, TEST }
|
||||
fun ModuleDescriptor.hasDeclarationOf(descriptor: MemberDescriptor) = declarationOf(descriptor) != null
|
||||
|
||||
private fun ModuleDescriptor.declarationOf(descriptor: MemberDescriptor): DeclarationDescriptor? =
|
||||
with(HeaderImplDeclarationChecker(this)) {
|
||||
descriptor.findCompatibleHeaderForImpl().firstOrNull()
|
||||
with(HeaderImplDeclarationChecker) {
|
||||
descriptor.findCompatibleHeaderForImpl(this@declarationOf).firstOrNull()
|
||||
}
|
||||
|
||||
fun getHeaderDeclarationTooltip(declaration: KtDeclaration): String? {
|
||||
|
||||
@@ -34,8 +34,8 @@ fun ModuleDescriptor.hasImplementationsOf(descriptor: MemberDescriptor) =
|
||||
implementationsOf(descriptor).isNotEmpty()
|
||||
|
||||
private fun ModuleDescriptor.implementationsOf(descriptor: MemberDescriptor): List<DeclarationDescriptor> =
|
||||
with(HeaderImplDeclarationChecker(this)) {
|
||||
descriptor.findCompatibleImplForHeader()
|
||||
with(HeaderImplDeclarationChecker) {
|
||||
descriptor.findCompatibleImplForHeader(this@implementationsOf)
|
||||
}
|
||||
|
||||
fun getPlatformImplementationTooltip(declaration: KtDeclaration): String? {
|
||||
|
||||
Reference in New Issue
Block a user