aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Model/DocumentationBuilder.kt2
-rw-r--r--src/main.kt2
-rw-r--r--test/data/functions/functionWithParams.kt2
-rw-r--r--test/playground.kt5
-rw-r--r--test/src/TestAPI.kt2
-rw-r--r--test/src/model/FunctionTest.kt1
6 files changed, 9 insertions, 5 deletions
diff --git a/src/Model/DocumentationBuilder.kt b/src/Model/DocumentationBuilder.kt
index 08298926..e28d437f 100644
--- a/src/Model/DocumentationBuilder.kt
+++ b/src/Model/DocumentationBuilder.kt
@@ -5,7 +5,7 @@ import org.jetbrains.jet.lang.psi.*
import org.jetbrains.jet.lang.descriptors.*
import org.jetbrains.jet.lang.descriptors.impl.*
-fun BindingContext.createDocumentation(file: JetFile): DocumentationModel {
+fun BindingContext.createSourceModel(file: JetFile): DocumentationModel {
val model = DocumentationModel()
val packageFragment = getPackageFragment(file)
if (packageFragment == null) throw IllegalArgumentException("File $file should have package fragment")
diff --git a/src/main.kt b/src/main.kt
index 79a8bfcb..30c3a737 100644
--- a/src/main.kt
+++ b/src/main.kt
@@ -37,7 +37,7 @@ public fun main(args: Array<String>) {
val model = environment.processFiles { context, file ->
println("Processing: ${file.getName()}")
- context.createDocumentation(file)
+ context.createSourceModel(file)
}.fold(DocumentationModel()) {(aggregate, item) -> aggregate.merge(item) }
ConsoleGenerator().generate(model)
diff --git a/test/data/functions/functionWithParams.kt b/test/data/functions/functionWithParams.kt
index 559f4f78..52cd0744 100644
--- a/test/data/functions/functionWithParams.kt
+++ b/test/data/functions/functionWithParams.kt
@@ -3,5 +3,5 @@
* Function
* Documentation
*/
-fun function(x: Int) {
+fun function(/** parameter */ x: Int) {
} \ No newline at end of file
diff --git a/test/playground.kt b/test/playground.kt
index 50a43dfd..455e56ff 100644
--- a/test/playground.kt
+++ b/test/playground.kt
@@ -1,5 +1,6 @@
// this file is not included in sources or tests, you can play with it for debug purposes
// Console run configuration will analyse it and provide lots of debug output
+package dokka.playground
fun topLevelFunction() {
}
@@ -32,9 +33,11 @@ class ClassWithConstructor(val name: String)
/**
* This is data class with constructor and comment after doc
+ * $name Person's name
+ * $age Person's age
*/
// irrelevant comment
-data class DataClass(val name: String, val age: Int) {}
+data class Person(/** Doc at parameter */ val name: String, val age: Int) {}
object Object {
fun objectFunction() {
diff --git a/test/src/TestAPI.kt b/test/src/TestAPI.kt
index 65254bca..e5669569 100644
--- a/test/src/TestAPI.kt
+++ b/test/src/TestAPI.kt
@@ -28,7 +28,7 @@ public fun verifyModel(vararg files: String, verifier: (DocumentationModel) -> U
}
val result = environment.processFiles { context, file ->
- context.createDocumentation(file)
+ context.createSourceModel(file)
}.fold(DocumentationModel()) {(aggregate, item) -> aggregate.merge(item) }
verifier(result)
Disposer.dispose(environment)
diff --git a/test/src/model/FunctionTest.kt b/test/src/model/FunctionTest.kt
index 90b937de..528166e6 100644
--- a/test/src/model/FunctionTest.kt
+++ b/test/src/model/FunctionTest.kt
@@ -30,6 +30,7 @@ Documentation"""
with(details.single()) {
assertEquals("x", name)
assertEquals(DocumentationNodeKind.Parameter, kind)
+ assertEquals("parameter", doc)
assertTrue(details.none())
assertTrue(members.none())
assertTrue(links.none())