diff options
author | Dmitry Jemerov <intelliyole@gmail.com> | 2015-01-13 16:40:49 +0100 |
---|---|---|
committer | Dmitry Jemerov <intelliyole@gmail.com> | 2015-01-13 16:40:49 +0100 |
commit | ec6fcb4f0a00c66c410c2735af58bb0c5275f9a9 (patch) | |
tree | dd229d28ae73a3cabe74fdd42712fd08294feee6 | |
parent | 891cc8569d535c3ac5ade23d7fd56dbca619e05b (diff) | |
parent | 2e277ba086f727c755e584f93280cb4d00e7444e (diff) | |
download | dokka-ec6fcb4f0a00c66c410c2735af58bb0c5275f9a9.tar.gz dokka-ec6fcb4f0a00c66c410c2735af58bb0c5275f9a9.tar.bz2 dokka-ec6fcb4f0a00c66c410c2735af58bb0c5275f9a9.zip |
Merge pull request #12 from orangy/varargs
correcty represent vararg parameters
-rw-r--r-- | src/Kotlin/DocumentationBuilder.kt | 8 | ||||
-rw-r--r-- | test/data/format/varargsFunction.kt | 1 | ||||
-rw-r--r-- | test/data/format/varargsFunction.md | 12 | ||||
-rw-r--r-- | test/src/format/MarkdownFormatTest.kt | 6 |
4 files changed, 26 insertions, 1 deletions
diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt index a9b017bb..40c6d745 100644 --- a/src/Kotlin/DocumentationBuilder.kt +++ b/src/Kotlin/DocumentationBuilder.kt @@ -293,7 +293,13 @@ class DocumentationBuilder(val session: ResolveSession, val options: Documentati fun ValueParameterDescriptor.build(): DocumentationNode { val node = DocumentationNode(this, Kind.Parameter) - node.appendType(getType()) + val varargType = getVarargElementType() + if (varargType != null) { + node.append(DocumentationNode("vararg", Content.Empty, Kind.Annotation), DocumentationReference.Kind.Annotation) + node.appendType(varargType) + } else { + node.appendType(getType()) + } node.appendAnnotations(this) register(this, node) return node diff --git a/test/data/format/varargsFunction.kt b/test/data/format/varargsFunction.kt new file mode 100644 index 00000000..deea127b --- /dev/null +++ b/test/data/format/varargsFunction.kt @@ -0,0 +1 @@ +fun f(vararg s: String) {} diff --git a/test/data/format/varargsFunction.md b/test/data/format/varargsFunction.md new file mode 100644 index 00000000..c86132bc --- /dev/null +++ b/test/data/format/varargsFunction.md @@ -0,0 +1,12 @@ +[test](out.md) / [](out.md) / [f](out.md) + + +# f + + +``` +fun f(vararg s: String): Unit +``` + + + diff --git a/test/src/format/MarkdownFormatTest.kt b/test/src/format/MarkdownFormatTest.kt index a5a62e13..f7fc6da0 100644 --- a/test/src/format/MarkdownFormatTest.kt +++ b/test/src/format/MarkdownFormatTest.kt @@ -55,4 +55,10 @@ public class MarkdownFormatTest { enumClassNode.members.filter { it.name == "LOCAL_CONTINUE_AND_BREAK" }) } } + + Test fun varargsFunction() { + verifyOutput("test/data/format/varargsFunction.kt", ".md") { model, output -> + markdownService.appendNodes(tempLocation, output, model.members.single().members) + } + } } |