aboutsummaryrefslogtreecommitdiff
path: root/kotlin-analysis/src/main
diff options
context:
space:
mode:
authorMarcin Aman <marcin.aman@gmail.com>2021-03-03 13:01:14 +0100
committerGitHub <noreply@github.com>2021-03-03 13:01:14 +0100
commit69dc33255c2cd1cb77b74325c89bc6a3ba34c6fa (patch)
tree628ec2d5b8f863433b63beb0fd393e13a774a5c7 /kotlin-analysis/src/main
parent7cf644f064868934fe8dcb46ab150f25fab8e8c8 (diff)
downloaddokka-69dc33255c2cd1cb77b74325c89bc6a3ba34c6fa.tar.gz
dokka-69dc33255c2cd1cb77b74325c89bc6a3ba34c6fa.tar.bz2
dokka-69dc33255c2cd1cb77b74325c89bc6a3ba34c6fa.zip
Bump artefacts to 1.4.30 (#1726)
* 1.4.30-RC * Bump artefacts to 1.4.30
Diffstat (limited to 'kotlin-analysis/src/main')
-rw-r--r--kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt15
-rw-r--r--kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/CoreProjectFileIndex.kt22
-rw-r--r--kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/DokkaNativeResolverForModuleFactory.kt4
-rw-r--r--kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/TypeReferenceFactory.kt1
4 files changed, 25 insertions, 17 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 d516d57d..ef850279 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
@@ -13,6 +13,7 @@ import com.intellij.openapi.project.Project
import com.intellij.openapi.roots.OrderEnumerationHandler
import com.intellij.openapi.roots.ProjectFileIndex
import com.intellij.openapi.roots.ProjectRootManager
+import com.intellij.openapi.roots.impl.ProjectRootManagerImpl
import com.intellij.openapi.util.Disposer
import com.intellij.openapi.vfs.StandardFileSystems
import com.intellij.psi.impl.source.javadoc.JavadocManagerImpl
@@ -342,8 +343,6 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl
projectContext,
modules = module.dependencies()
) {
- override fun sdkDependency(module: ModuleInfo): ModuleInfo? = null
-
override fun modulesContent(module: ModuleInfo): ModuleContent<ModuleInfo> = modulesContent(module)
override fun builtInsForModule(module: ModuleInfo): KotlinBuiltIns = DefaultBuiltIns.Instance
@@ -366,6 +365,9 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl
this,
LanguageVersionSettingsImpl.DEFAULT
)
+
+ override fun sdkDependency(module: ModuleInfo, ownerModuleDescriptor: ModuleDescriptorImpl?): ModuleInfo? =
+ null
}
}
@@ -395,7 +397,8 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl
override fun builtInsForModule(module: ModuleInfo): KotlinBuiltIns = DefaultBuiltIns.Instance
- override fun sdkDependency(module: ModuleInfo): ModuleInfo? = null
+ override fun sdkDependency(module: ModuleInfo, ownerModuleDescriptor: ModuleDescriptorImpl?): ModuleInfo? =
+ null
}
}
@@ -426,7 +429,8 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl
override fun builtInsForModule(module: ModuleInfo): KotlinBuiltIns = DefaultBuiltIns.Instance
- override fun sdkDependency(module: ModuleInfo): ModuleInfo? = null
+ override fun sdkDependency(module: ModuleInfo, ownerModuleDescriptor: ModuleDescriptorImpl?): ModuleInfo? =
+ null
}
}
@@ -491,7 +495,8 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl
LanguageVersionSettingsImpl.DEFAULT
)
- override fun sdkDependency(module: ModuleInfo): ModuleInfo? = null
+ override fun sdkDependency(module: ModuleInfo, ownerModuleDescriptor: ModuleDescriptorImpl?): ModuleInfo? =
+ null
}
}
diff --git a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/CoreProjectFileIndex.kt b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/CoreProjectFileIndex.kt
index 77be818c..179f5e52 100644
--- a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/CoreProjectFileIndex.kt
+++ b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/CoreProjectFileIndex.kt
@@ -9,7 +9,7 @@ import com.intellij.openapi.projectRoots.SdkAdditionalData
import com.intellij.openapi.projectRoots.SdkModificator
import com.intellij.openapi.projectRoots.SdkTypeId
import com.intellij.openapi.roots.*
-import com.intellij.openapi.roots.impl.ProjectOrderEnumerator
+import com.intellij.openapi.roots.impl.ProjectRootManagerImpl
import com.intellij.openapi.util.Condition
import com.intellij.openapi.util.Key
import com.intellij.openapi.util.UserDataHolderBase
@@ -31,7 +31,8 @@ import java.io.File
* Workaround for the lack of ability to create a ProjectFileIndex implementation using only
* classes from projectModel-{api,impl}.
*/
-class CoreProjectFileIndex(private val project: Project, contentRoots: List<ContentRoot>) : ProjectFileIndex, ModuleFileIndex {
+class CoreProjectFileIndex(private val project: Project, contentRoots: List<ContentRoot>) : ProjectFileIndex,
+ ModuleFileIndex {
override fun iterateContent(p0: ContentIterator, p1: VirtualFileFilter?): Boolean {
throw UnsupportedOperationException()
}
@@ -147,8 +148,8 @@ class CoreProjectFileIndex(private val project: Project, contentRoots: List<Cont
private val sdk: Sdk = object : Sdk, RootProvider {
override fun getFiles(rootType: OrderRootType): Array<out VirtualFile> = classpathRoots
- .mapNotNull { StandardFileSystems.local().findFileByPath(it.file.path) }
- .toTypedArray()
+ .mapNotNull { StandardFileSystems.local().findFileByPath(it.file.path) }
+ .toTypedArray()
override fun addRootSetChangedListener(p0: RootProvider.RootSetChangedListener) {
throw UnsupportedOperationException()
@@ -334,11 +335,11 @@ class CoreProjectFileIndex(private val project: Project, contentRoots: List<Cont
}
override fun orderEntries(): OrderEnumerator =
- ProjectOrderEnumerator(project, null).using(object : RootModelProvider {
- override fun getModules(): Array<out Module> = arrayOf(module)
+ ProjectRootManagerImpl(project).orderEntries().using(object : RootModelProvider {
+ override fun getModules(): Array<out Module> = arrayOf(module)
- override fun getRootModel(p0: Module): ModuleRootModel = this@MyModuleRootManager
- })
+ override fun getRootModel(p0: Module): ModuleRootModel = this@MyModuleRootManager
+ })
override fun <T : Any?> getModuleExtension(p0: Class<T>): T {
throw UnsupportedOperationException()
@@ -418,7 +419,8 @@ class CoreProjectFileIndex(private val project: Project, contentRoots: List<Cont
override fun isInLibrarySource(file: VirtualFile): Boolean = false
override fun getClassRootForFile(file: VirtualFile): VirtualFile? =
- classpathRoots.firstOrNull { it.contains(file) }?.let { StandardFileSystems.local().findFileByPath(it.file.path) }
+ classpathRoots.firstOrNull { it.contains(file) }
+ ?.let { StandardFileSystems.local().findFileByPath(it.file.path) }
override fun getOrderEntriesForFile(file: VirtualFile): List<OrderEntry> =
if (classpathRoots.contains(file)) listOf(sdkOrderEntry) else emptyList()
@@ -442,7 +444,7 @@ class CoreProjectFileIndex(private val project: Project, contentRoots: List<Cont
}
override fun getModuleForFile(file: VirtualFile): Module? =
- if (sourceRoots.contains(file)) module else null
+ if (sourceRoots.contains(file)) module else null
private fun List<ContentRoot>.contains(file: VirtualFile): Boolean = any { it.contains(file) }
diff --git a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/DokkaNativeResolverForModuleFactory.kt b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/DokkaNativeResolverForModuleFactory.kt
index a0135d40..f849c229 100644
--- a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/DokkaNativeResolverForModuleFactory.kt
+++ b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/DokkaNativeResolverForModuleFactory.kt
@@ -13,6 +13,7 @@ import org.jetbrains.kotlin.incremental.components.LookupTracker
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.konan.platform.NativePlatformAnalyzerServices
import org.jetbrains.kotlin.resolve.lazy.ResolveSession
@@ -31,7 +32,8 @@ internal class DokkaNativeResolverForModuleFactory(
moduleContext: ModuleContext,
moduleContent: ModuleContent<M>,
resolverForProject: ResolverForProject<M>,
- languageVersionSettings: LanguageVersionSettings
+ languageVersionSettings: LanguageVersionSettings,
+ sealedInheritorsProvider: SealedClassInheritorsProvider
): ResolverForModule {
val declarationProviderFactory = DeclarationProviderFactoryService.createDeclarationProviderFactory(
diff --git a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/TypeReferenceFactory.kt b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/TypeReferenceFactory.kt
index 169831d4..e62548d7 100644
--- a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/TypeReferenceFactory.kt
+++ b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/TypeReferenceFactory.kt
@@ -36,7 +36,6 @@ private fun TypeReference.Companion.fromPossiblyRecursive(t: KotlinType, paramTr
private fun TypeReference.Companion.from(t: KotlinType, paramTrace: List<KotlinType>): TypeReference {
if (t is UnresolvedType) {
- println("Unresolved type with presentable name: ${t.presentableName}")
return TypeConstructor(
t.presentableName, t.arguments.map { fromProjection(it, paramTrace) }
)