aboutsummaryrefslogtreecommitdiff
path: root/kotlin-analysis/src/main
diff options
context:
space:
mode:
authorMarcin Aman <marcin.aman@gmail.com>2021-05-06 11:09:42 +0200
committerGitHub <noreply@github.com>2021-05-06 11:09:42 +0200
commit76c26f3325ebe0c06779fca09bbef0eefac5aa5a (patch)
tree2b39bcd386c90fe6311224acd0c3c765974dacb7 /kotlin-analysis/src/main
parent326048cd6ed3334a84e489dac8c692bc184709c0 (diff)
downloaddokka-76c26f3325ebe0c06779fca09bbef0eefac5aa5a.tar.gz
dokka-76c26f3325ebe0c06779fca09bbef0eefac5aa5a.tar.bz2
dokka-76c26f3325ebe0c06779fca09bbef0eefac5aa5a.zip
Bump compiler to 1.5.0 (#1856)
* Bump compiler to 1.5.0 * Include Api changes
Diffstat (limited to 'kotlin-analysis/src/main')
-rw-r--r--kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt19
-rw-r--r--kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/CoreKotlinCacheService.kt8
-rw-r--r--kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/DokkaResolutionFacade.kt6
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()
}