diff options
author | Vadim Mishenev <vad-mishenev@yandex.ru> | 2022-09-01 17:21:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-01 17:21:56 +0300 |
commit | 92e3d56042d34cb64d672aa7099fe72831ed849f (patch) | |
tree | 1150f3e1edcd9d3f11e4ac1eefe603ff0d2cbb77 /kotlin-analysis/src | |
parent | c9f1d60af8776c14d35ed11f512c3c7b0dfad3a2 (diff) | |
download | dokka-92e3d56042d34cb64d672aa7099fe72831ed849f.tar.gz dokka-92e3d56042d34cb64d672aa7099fe72831ed849f.tar.bz2 dokka-92e3d56042d34cb64d672aa7099fe72831ed849f.zip |
Add `DynamicTypeDeserializer` (#2645)
Diffstat (limited to 'kotlin-analysis/src')
-rw-r--r-- | kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/resolve/DokkaJsResolverForModuleFactory.kt | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/resolve/DokkaJsResolverForModuleFactory.kt b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/resolve/DokkaJsResolverForModuleFactory.kt index 93214592..353c71fb 100644 --- a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/resolve/DokkaJsResolverForModuleFactory.kt +++ b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/resolve/DokkaJsResolverForModuleFactory.kt @@ -1,7 +1,7 @@ package org.jetbrains.dokka.analysis.resolve import org.jetbrains.kotlin.analyzer.* -import org.jetbrains.kotlin.builtins.konan.KonanBuiltIns +import org.jetbrains.kotlin.builtins.DefaultBuiltIns import org.jetbrains.kotlin.config.LanguageVersionSettings import org.jetbrains.kotlin.container.StorageComponentContainer import org.jetbrains.kotlin.container.get @@ -14,14 +14,15 @@ import org.jetbrains.kotlin.idea.klib.createKlibPackageFragmentProvider import org.jetbrains.kotlin.incremental.components.LookupTracker import org.jetbrains.kotlin.js.resolve.JsPlatformAnalyzerServices import org.jetbrains.kotlin.konan.util.KlibMetadataFactories -import org.jetbrains.kotlin.library.metadata.NullFlexibleTypeDeserializer import org.jetbrains.kotlin.resolve.CodeAnalyzerInitializer import org.jetbrains.kotlin.resolve.SealedClassInheritorsProvider import org.jetbrains.kotlin.resolve.TargetEnvironment import org.jetbrains.kotlin.resolve.lazy.ResolveSession import org.jetbrains.kotlin.resolve.lazy.declarations.DeclarationProviderFactoryService +import org.jetbrains.kotlin.serialization.js.DynamicTypeDeserializer import org.jetbrains.kotlin.serialization.js.KotlinJavascriptSerializationUtil import org.jetbrains.kotlin.serialization.js.createKotlinJavascriptPackageFragmentProvider +import org.jetbrains.kotlin.serialization.konan.impl.KlibMetadataModuleDescriptorFactoryImpl import org.jetbrains.kotlin.utils.KotlinJavascriptMetadataUtils import java.io.File @@ -30,7 +31,14 @@ internal class DokkaJsResolverForModuleFactory( private val targetEnvironment: TargetEnvironment ) : ResolverForModuleFactory() { companion object { - private val metadataFactories = KlibMetadataFactories(::KonanBuiltIns, NullFlexibleTypeDeserializer) + private val metadataFactories = KlibMetadataFactories({ DefaultBuiltIns.Instance }, DynamicTypeDeserializer) + + private val metadataModuleDescriptorFactory = KlibMetadataModuleDescriptorFactoryImpl( + metadataFactories.DefaultDescriptorFactory, + metadataFactories.DefaultPackageFragmentsFactory, + metadataFactories.flexibleTypeDeserializer, + metadataFactories.platformDependentTypeTransformer + ) } override fun <M : ModuleInfo> createResolverForModule( @@ -82,7 +90,7 @@ internal class DokkaJsResolverForModuleFactory( moduleInfo.kotlinLibrary .createKlibPackageFragmentProvider( storageManager = moduleContext.storageManager, - metadataModuleDescriptorFactory = metadataFactories.DefaultDeserializedDescriptorFactory, + metadataModuleDescriptorFactory = metadataModuleDescriptorFactory, languageVersionSettings = languageVersionSettings, moduleDescriptor = moduleDescriptor, lookupTracker = LookupTracker.DO_NOTHING |