[Misc] Provide meaningful debugName for StorageManager everywhere
This commit is contained in:
+1
-1
@@ -90,7 +90,7 @@ object CommonResolverForModuleFactory : ResolverForModuleFactory() {
|
||||
@Suppress("NAME_SHADOWING")
|
||||
val resolver = ResolverForProjectImpl(
|
||||
"sources for metadata serializer",
|
||||
ProjectContext(project),
|
||||
ProjectContext(project, "metadata serializer"),
|
||||
listOf(moduleInfo),
|
||||
modulesContent = { ModuleContent(it, files, GlobalSearchScope.allScope(project)) },
|
||||
moduleLanguageSettingsProvider = object : LanguageSettingsProvider {
|
||||
|
||||
+1
-1
@@ -276,7 +276,7 @@ object TopDownAnalyzerFacadeForJVM {
|
||||
}
|
||||
|
||||
private fun createModuleContext(project: Project, configuration: CompilerConfiguration): MutableModuleContext {
|
||||
val projectContext = ProjectContext(project)
|
||||
val projectContext = ProjectContext(project, "TopDownAnalyzer for JVM")
|
||||
val builtIns = JvmBuiltIns(projectContext.storageManager, JvmBuiltIns.Kind.FROM_DEPENDENCIES)
|
||||
return ContextForNewModule(
|
||||
projectContext, Name.special("<${configuration.getNotNull(CommonConfigurationKeys.MODULE_NAME)}>"), builtIns, null
|
||||
|
||||
@@ -83,14 +83,14 @@ class MutableModuleContextImpl(
|
||||
projectContext: ProjectContext
|
||||
) : MutableModuleContext, ProjectContext by projectContext
|
||||
|
||||
fun GlobalContext(): GlobalContextImpl {
|
||||
fun GlobalContext(debugName: String): GlobalContextImpl {
|
||||
val tracker = ExceptionTracker()
|
||||
return GlobalContextImpl(LockBasedStorageManager.createWithExceptionHandling("GlobalContext", tracker), tracker)
|
||||
return GlobalContextImpl(LockBasedStorageManager.createWithExceptionHandling(debugName, tracker), tracker)
|
||||
}
|
||||
|
||||
fun ProjectContext(project: Project): ProjectContext = ProjectContextImpl(project, GlobalContext())
|
||||
fun ModuleContext(module: ModuleDescriptor, project: Project): ModuleContext =
|
||||
ModuleContextImpl(module, ProjectContext(project))
|
||||
fun ProjectContext(project: Project, debugName: String): ProjectContext = ProjectContextImpl(project, GlobalContext(debugName))
|
||||
fun ModuleContext(module: ModuleDescriptor, project: Project, debugName: String): ModuleContext =
|
||||
ModuleContextImpl(module, ProjectContext(project, debugName))
|
||||
|
||||
fun GlobalContext.withProject(project: Project): ProjectContext = ProjectContextImpl(project, this)
|
||||
fun ProjectContext.withModule(module: ModuleDescriptor): ModuleContext = ModuleContextImpl(module, this)
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ fun createResolveSessionForFiles(
|
||||
syntheticFiles: Collection<KtFile>,
|
||||
addBuiltIns: Boolean
|
||||
): ResolveSession {
|
||||
val projectContext = ProjectContext(project)
|
||||
val projectContext = ProjectContext(project, "lazy resolve test utils")
|
||||
val testModule = TestModule(addBuiltIns)
|
||||
val resolverForProject = ResolverForProjectImpl(
|
||||
"test",
|
||||
|
||||
@@ -35,7 +35,7 @@ import org.jetbrains.kotlin.types.expressions.FakeCallResolver
|
||||
fun createContainerForTests(project: Project, module: ModuleDescriptor): ContainerForTests {
|
||||
return ContainerForTests(createContainer("Tests", JvmPlatformCompilerServices) {
|
||||
configureModule(
|
||||
ModuleContext(module, project),
|
||||
ModuleContext(module, project, "container for tests"),
|
||||
JvmPlatforms.defaultJvmPlatform,
|
||||
JvmPlatformCompilerServices,
|
||||
BindingTraceContext(),
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ class MultiModuleJavaAnalysisCustomTest : KtUsefulTestCase() {
|
||||
val moduleDirs = File(PATH_TO_TEST_ROOT_DIR).listFiles { it -> it.isDirectory }!!
|
||||
val environment = createEnvironment(moduleDirs)
|
||||
val modules = setupModules(environment, moduleDirs)
|
||||
val projectContext = ProjectContext(environment.project)
|
||||
val projectContext = ProjectContext(environment.project, "MultiModuleJavaAnalysisTest")
|
||||
val builtIns = JvmBuiltIns(projectContext.storageManager, JvmBuiltIns.Kind.FROM_CLASS_LOADER)
|
||||
val resolverForProject = ResolverForProjectImpl(
|
||||
"test",
|
||||
|
||||
@@ -76,7 +76,10 @@ class JsVersionRequirementTest : AbstractVersionRequirementTest() {
|
||||
|
||||
private fun createModule(environment: KotlinCoreEnvironment): MutableModuleContext {
|
||||
val config = JsConfig(environment.project, environment.configuration)
|
||||
return ContextForNewModule(ProjectContext(environment.project), Name.special("<test>"), JsPlatformCompilerServices.builtIns, null).apply {
|
||||
return ContextForNewModule(
|
||||
ProjectContext(environment.project, "ProjectContext"),
|
||||
Name.special("<test>"), JsPlatformCompilerServices.builtIns, null
|
||||
).apply {
|
||||
setDependencies(listOf(module) + config.moduleDescriptors + module.builtIns.builtInsModule)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ public class DefaultModalityModifiersTest extends KotlinTestWithEnvironment {
|
||||
}
|
||||
|
||||
private ClassDescriptorWithResolutionScopes createClassDescriptor(ClassKind kind, KtClass aClass) {
|
||||
ModuleContext moduleContext = ContextKt.ModuleContext(root, getProject());
|
||||
ModuleContext moduleContext = ContextKt.ModuleContext(root, getProject(), "DefaultModalityModifiersTest");
|
||||
Collection<KtFile> files = Collections.singleton(aClass.getContainingKtFile());
|
||||
|
||||
StorageComponentContainer container = createContainerForLazyResolve(
|
||||
|
||||
Reference in New Issue
Block a user