From 2ebfb98fb887c7697be3ed28dc357094036780bc Mon Sep 17 00:00:00 2001 From: Ilya Ryzhenkov Date: Mon, 13 Oct 2014 00:19:18 +0400 Subject: Fix generation, add memory. --- test/src/TestAPI.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'test/src') 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>() + 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 -- cgit