From 1f556589a20a1013af476213b6a2d27e20dc42e8 Mon Sep 17 00:00:00 2001 From: Marco Pennekamp Date: Mon, 22 May 2023 18:32:10 +0200 Subject: [PATCH] [AA] KT-58257 Add module dependents exception for `KtBuiltinsModule` and `KtSdkModule` - The IDE implementation of `KotlinModuleDependentsProvider` cannot easily find all dependents for a builtins or SDK module. Instead, builtins and SDK changes can be handled via global module state modification events, because most modules will depend on builtins and SDK modules. --- .../project/structure/KotlinModuleDependentsProvider.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/analysis/project-structure/src/org/jetbrains/kotlin/analysis/project/structure/KotlinModuleDependentsProvider.kt b/analysis/project-structure/src/org/jetbrains/kotlin/analysis/project/structure/KotlinModuleDependentsProvider.kt index 828658ad42e..b8bb0e78ae4 100644 --- a/analysis/project-structure/src/org/jetbrains/kotlin/analysis/project/structure/KotlinModuleDependentsProvider.kt +++ b/analysis/project-structure/src/org/jetbrains/kotlin/analysis/project/structure/KotlinModuleDependentsProvider.kt @@ -10,6 +10,11 @@ import com.intellij.openapi.project.Project /** * [KotlinModuleDependentsProvider] provides dependents for a [KtModule], which are modules that depend on the [KtModule]. * + * [getDirectDependents] and [getTransitiveDependents] may return an empty set for [KtBuiltinsModule]s and [KtSdkModule]s even though most + * modules depend on builtins/SDKs, because it is often not feasible to compute that set. Instead, users of [KotlinModuleDependentsProvider] + * should keep this limitation in mind and handle it separately. For example, a global modification event should be published for builtins + * and SDK changes. + * * Implementations of this provider should ensure that results are provided in reasonable time, for example by caching results, as its * functions may be called frequently. */