aboutsummaryrefslogtreecommitdiff
path: root/src/Kotlin
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-05-27 18:30:57 +0200
committerDmitry Jemerov <yole@jetbrains.com>2015-05-27 18:30:57 +0200
commit70a70ca9dad31477877251b271a329d048f7873f (patch)
tree8fd0af9a420cc7a2e489fa6b417391379f23dfe4 /src/Kotlin
parentd9f135d0a783461cd8650440230a5c0c8613ea29 (diff)
downloaddokka-70a70ca9dad31477877251b271a329d048f7873f.tar.gz
dokka-70a70ca9dad31477877251b271a329d048f7873f.tar.bz2
dokka-70a70ca9dad31477877251b271a329d048f7873f.zip
update to M12 compiler API; store dependency jars in VCS instead of depending on Kotlin plugin via path variable
Diffstat (limited to 'src/Kotlin')
-rw-r--r--src/Kotlin/ContentBuilder.kt4
-rw-r--r--src/Kotlin/DocumentationBuilder.kt8
2 files changed, 7 insertions, 5 deletions
diff --git a/src/Kotlin/ContentBuilder.kt b/src/Kotlin/ContentBuilder.kt
index f454c8fe..3dd5c00e 100644
--- a/src/Kotlin/ContentBuilder.kt
+++ b/src/Kotlin/ContentBuilder.kt
@@ -120,7 +120,7 @@ fun DocumentationBuilder.functionBody(descriptor: DeclarationDescriptor, functio
logger.warn("Missing function name in @sample in ${descriptor.signature()}")
return ContentBlockCode().let() { it.append(ContentText("Missing function name in @sample")); it }
}
- val scope = getResolutionScope(session, descriptor)
+ val scope = getResolutionScope(resolutionFacade, descriptor)
val rootPackage = session.getModuleDescriptor().getPackage(FqName.ROOT)!!
val rootScope = rootPackage.getMemberScope()
val symbol = resolveInScope(functionName, scope) ?: resolveInScope(functionName, rootScope)
@@ -169,7 +169,7 @@ private fun DocumentationBuilder.resolveInScope(functionName: String, scope: Jet
currentScope = if (partSymbol is ClassDescriptor)
partSymbol.getDefaultType().getMemberScope()
else
- getResolutionScope(session, partSymbol)
+ getResolutionScope(resolutionFacade, partSymbol)
symbol = partSymbol
}
diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt
index 8910c3e3..02ced7a4 100644
--- a/src/Kotlin/DocumentationBuilder.kt
+++ b/src/Kotlin/DocumentationBuilder.kt
@@ -8,6 +8,7 @@ import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.annotations.Annotated
import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor
import org.jetbrains.kotlin.descriptors.impl.EnumEntrySyntheticClassDescriptor
+import org.jetbrains.kotlin.idea.caches.resolve.ResolutionFacade
import org.jetbrains.kotlin.idea.kdoc.KDocFinder
import org.jetbrains.kotlin.idea.kdoc.resolveKDocLink
import org.jetbrains.kotlin.kdoc.psi.impl.KDocSection
@@ -37,7 +38,8 @@ private fun isSamePackage(descriptor1: DeclarationDescriptor, descriptor2: Decla
return package1 != null && package2 != null && package1.fqName == package2.fqName
}
-class DocumentationBuilder(val session: ResolveSession,
+class DocumentationBuilder(val resolutionFacade: ResolutionFacade,
+ val session: ResolveSession,
val options: DocumentationOptions,
val refGraph: NodeReferenceGraph,
val logger: DokkaLogger) {
@@ -172,7 +174,7 @@ class DocumentationBuilder(val session: ResolveSession,
fun resolveContentLink(descriptor: DeclarationDescriptor, href: String): ContentBlock {
val symbol = try {
- val symbols = resolveKDocLink(session, descriptor, null, href.split('.').toList())
+ val symbols = resolveKDocLink(resolutionFacade, descriptor, null, href.split('.').toList())
findTargetSymbol(symbols)
} catch(e: Exception) {
null
@@ -425,7 +427,7 @@ class DocumentationBuilder(val session: ResolveSession,
fun ClassDescriptor.build(): DocumentationNode {
val kind = when (getKind()) {
ClassKind.OBJECT -> Kind.Object
- ClassKind.TRAIT -> Kind.Interface
+ ClassKind.INTERFACE -> Kind.Interface
ClassKind.ENUM_CLASS -> Kind.Enum
ClassKind.ANNOTATION_CLASS -> Kind.AnnotationClass
ClassKind.ENUM_ENTRY -> Kind.EnumItem