aboutsummaryrefslogtreecommitdiff
path: root/src/Kotlin/DocumentationBuilder.kt
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-10-13 20:14:45 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-10-13 20:14:45 +0400
commit1cb3af902c8f2e3f73e7c78781373f1ab5788772 (patch)
tree88aaa6a10f0da26d28e9c2792313a2a11cf28356 /src/Kotlin/DocumentationBuilder.kt
parentefd1947722587d15bf1c81a0fd7ca722a7bc6fa8 (diff)
downloaddokka-1cb3af902c8f2e3f73e7c78781373f1ab5788772.tar.gz
dokka-1cb3af902c8f2e3f73e7c78781373f1ab5788772.tar.bz2
dokka-1cb3af902c8f2e3f73e7c78781373f1ab5788772.zip
Remove BindingContext and migrate to ResolveSession, discover symbols for {code ...} directive.
Diffstat (limited to 'src/Kotlin/DocumentationBuilder.kt')
-rw-r--r--src/Kotlin/DocumentationBuilder.kt7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt
index b18902e4..cee374d9 100644
--- a/src/Kotlin/DocumentationBuilder.kt
+++ b/src/Kotlin/DocumentationBuilder.kt
@@ -11,10 +11,11 @@ import org.jetbrains.jet.lang.resolve.name.Name
import org.jetbrains.jet.lang.resolve.scopes.JetScope
import org.jetbrains.jet.lang.psi.JetFile
import org.jetbrains.jet.lang.resolve.name.FqName
+import org.jetbrains.jet.lang.resolve.lazy.ResolveSession
public data class DocumentationOptions(val includeNonPublic: Boolean = false)
-class DocumentationBuilder(val context: BindingContext, val options: DocumentationOptions) {
+class DocumentationBuilder(val session: ResolveSession, val options: DocumentationOptions) {
val visibleToDocumentation = setOf(Visibilities.INTERNAL, Visibilities.PROTECTED, Visibilities.PUBLIC)
val descriptorToNode = hashMapOf<DeclarationDescriptor, DocumentationNode>()
val nodeToDescriptor = hashMapOf<DocumentationNode, DeclarationDescriptor>()
@@ -22,7 +23,7 @@ class DocumentationBuilder(val context: BindingContext, val options: Documentati
val packages = hashMapOf<FqName, DocumentationNode>()
fun parseDocumentation(descriptor: DeclarationDescriptor): Content {
- val docText = context.getDocumentationElements(descriptor).map { it.extractText() }.join("\n")
+ val docText = descriptor.getDocumentationElements().map { it.extractText() }.join("\n")
val tree = MarkdownProcessor.parse(docText)
//println(tree.toTestString())
val content = buildContent(tree, descriptor)
@@ -295,7 +296,7 @@ class DocumentationBuilder(val context: BindingContext, val options: Documentati
fun getResolutionScope(node: DocumentationNode): JetScope {
val descriptor = nodeToDescriptor[node] ?: throw IllegalArgumentException("Node is not known to this context")
- return context.getResolutionScope(descriptor)
+ return getResolutionScope(descriptor)
}
fun resolveContentLinks(node: DocumentationNode, content: ContentNode) {