diff options
Diffstat (limited to 'kotlin-analysis/src')
3 files changed, 21 insertions, 12 deletions
diff --git a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt index 41bf4fb3..30f1f1fb 100644 --- a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt +++ b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt @@ -367,8 +367,7 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl LanguageVersionSettingsImpl.DEFAULT ) - override fun sdkDependency(module: ModuleInfo, ownerModuleDescriptor: ModuleDescriptorImpl?): ModuleInfo? = - null + override fun sdkDependency(module: ModuleInfo): ModuleInfo? = null } } @@ -398,8 +397,7 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl override fun builtInsForModule(module: ModuleInfo): KotlinBuiltIns = DefaultBuiltIns.Instance - override fun sdkDependency(module: ModuleInfo, ownerModuleDescriptor: ModuleDescriptorImpl?): ModuleInfo? = - null + override fun sdkDependency(module: ModuleInfo): ModuleInfo? = null } } @@ -430,8 +428,7 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl override fun builtInsForModule(module: ModuleInfo): KotlinBuiltIns = DefaultBuiltIns.Instance - override fun sdkDependency(module: ModuleInfo, ownerModuleDescriptor: ModuleDescriptorImpl?): ModuleInfo? = - null + override fun sdkDependency(module: ModuleInfo): ModuleInfo? = null } } @@ -470,7 +467,7 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl descriptor: ModuleDescriptor, moduleInfo: ModuleInfo ): ResolverForModule = JvmResolverForModuleFactory( - JvmPlatformParameters({ content -> + JvmPlatformParameters(packagePartProviderFactory = { content -> JvmPackagePartProvider( configuration.languageVersionSettings, content.moduleContentScope @@ -478,14 +475,15 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl .apply { addRoots(javaRoots, messageCollector) } - }, { + }, moduleByJavaClass = { val file = (it as? BinaryJavaClass)?.virtualFile ?: (it as JavaClassImpl).psi.containingFile.virtualFile if (file in sourcesScope) module else library - }), + }, resolverForReferencedModule = null, + useBuiltinsProviderForModule = { false }), CompilerEnvironment, unspecifiedJvmPlatform ).createResolverForModule( @@ -496,8 +494,7 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl LanguageVersionSettingsImpl.DEFAULT ) - override fun sdkDependency(module: ModuleInfo, ownerModuleDescriptor: ModuleDescriptorImpl?): ModuleInfo? = - null + override fun sdkDependency(module: ModuleInfo): ModuleInfo? = null } } diff --git a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/CoreKotlinCacheService.kt b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/CoreKotlinCacheService.kt index 68415875..bebbc705 100644 --- a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/CoreKotlinCacheService.kt +++ b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/CoreKotlinCacheService.kt @@ -4,6 +4,7 @@ import com.intellij.psi.PsiFile import org.jetbrains.dokka.analysis.DokkaResolutionFacade import org.jetbrains.kotlin.analyzer.ModuleInfo import org.jetbrains.kotlin.caches.resolve.KotlinCacheService +import org.jetbrains.kotlin.caches.resolve.PlatformAnalysisSettings import org.jetbrains.kotlin.idea.resolve.ResolutionFacade import org.jetbrains.kotlin.psi.KtElement import org.jetbrains.kotlin.resolve.diagnostics.KotlinSuppressCache @@ -30,6 +31,13 @@ class CoreKotlinCacheService(private val resolutionFacade: DokkaResolutionFacade override fun getResolutionFacadeByModuleInfo( moduleInfo: ModuleInfo, + settings: PlatformAnalysisSettings + ): ResolutionFacade? { + return resolutionFacade + } + + override fun getResolutionFacadeByModuleInfo( + moduleInfo: ModuleInfo, platform: org.jetbrains.kotlin.platform.TargetPlatform ): ResolutionFacade? { return resolutionFacade diff --git a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/DokkaResolutionFacade.kt b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/DokkaResolutionFacade.kt index 2c19fb9f..c0fafc25 100644 --- a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/DokkaResolutionFacade.kt +++ b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/DokkaResolutionFacade.kt @@ -13,6 +13,7 @@ import org.jetbrains.kotlin.container.getService import org.jetbrains.kotlin.container.tryGetService import org.jetbrains.kotlin.descriptors.DeclarationDescriptor import org.jetbrains.kotlin.descriptors.ModuleDescriptor +import org.jetbrains.kotlin.diagnostics.DiagnosticSink import org.jetbrains.kotlin.idea.FrontendInternals import org.jetbrains.kotlin.idea.resolve.ResolutionFacade import org.jetbrains.kotlin.psi.KtDeclaration @@ -33,7 +34,10 @@ class DokkaResolutionFacade( override val moduleDescriptor: ModuleDescriptor, val resolverForModule: ResolverForModule ) : ResolutionFacade { - override fun analyzeWithAllCompilerChecks(elements: Collection<KtElement>): AnalysisResult { + override fun analyzeWithAllCompilerChecks( + elements: Collection<KtElement>, + callback: DiagnosticSink.DiagnosticsCallback? + ): AnalysisResult { throw UnsupportedOperationException() } |