aboutsummaryrefslogtreecommitdiff
path: root/test/src
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-10-13 00:19:18 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-10-13 00:19:18 +0400
commit2ebfb98fb887c7697be3ed28dc357094036780bc (patch)
tree47ae5e27b3b0a014a6e18ce5dccc1eb4be3d6d90 /test/src
parentba1f12daf927d95a0a8c24c9f3e4a07274451b32 (diff)
downloaddokka-2ebfb98fb887c7697be3ed28dc357094036780bc.tar.gz
dokka-2ebfb98fb887c7697be3ed28dc357094036780bc.tar.bz2
dokka-2ebfb98fb887c7697be3ed28dc357094036780bc.zip
Fix generation, add memory.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/TestAPI.kt9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/src/TestAPI.kt b/test/src/TestAPI.kt
index fcff75e9..b885a15f 100644
--- a/test/src/TestAPI.kt
+++ b/test/src/TestAPI.kt
@@ -4,6 +4,7 @@ import org.jetbrains.jet.cli.common.messages.*
import com.intellij.openapi.util.*
import kotlin.test.fail
import org.jetbrains.dokka.*
+import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor
public fun verifyModel(vararg files: String, verifier: (DocumentationModule) -> Unit) {
val messageCollector = object : MessageCollector {
@@ -30,10 +31,16 @@ public fun verifyModel(vararg files: String, verifier: (DocumentationModule) ->
val options = DocumentationOptions(includeNonPublic = true)
val documentation = environment.withContext { environment, module, context ->
+ val fragments = environment.getSourceFiles().map { context.getPackageFragment(it) }.filterNotNull().distinct()
+ val descriptors = hashMapOf<String, List<DeclarationDescriptor>>()
+ for ((name, parts) in fragments.groupBy { it.fqName }) {
+ descriptors.put(name.asString(), parts.flatMap { it.getMemberScope().getAllDescriptors() })
+ }
+
val documentationModule = DocumentationModule("test")
val documentationBuilder = DocumentationBuilder(context, options)
with(documentationBuilder) {
- documentationModule.appendFiles(environment.getSourceFiles())
+ documentationModule.appendFragments(fragments)
}
documentationBuilder.resolveReferences(documentationModule)
documentationModule