aboutsummaryrefslogtreecommitdiff
path: root/src/Kotlin
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-01-14 20:23:44 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-01-14 20:23:44 +0100
commitcfc0348e120df881461ada2d3299f0fb4314f49e (patch)
tree2e52040fb3437146c77f1dbe6a33442a4ed71b4a /src/Kotlin
parent60e610ebdd86663bedf113d2235ac3c8364171d0 (diff)
parentfaad901ed29f802d7b304c06ae62954b149960e7 (diff)
downloaddokka-cfc0348e120df881461ada2d3299f0fb4314f49e.tar.gz
dokka-cfc0348e120df881461ada2d3299f0fb4314f49e.tar.bz2
dokka-cfc0348e120df881461ada2d3299f0fb4314f49e.zip
Merge branch 'property-var'
Conflicts: test/src/format/MarkdownFormatTest.kt
Diffstat (limited to 'src/Kotlin')
-rw-r--r--src/Kotlin/DocumentationBuilder.kt4
-rw-r--r--src/Kotlin/KotlinLanguageService.kt7
2 files changed, 9 insertions, 2 deletions
diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt
index 0b978370..d7ba8a32 100644
--- a/src/Kotlin/DocumentationBuilder.kt
+++ b/src/Kotlin/DocumentationBuilder.kt
@@ -285,6 +285,10 @@ class DocumentationBuilder(val session: ResolveSession, val options: Documentati
getExtensionReceiverParameter()?.let { node.appendChild(it, DocumentationReference.Kind.Detail) }
node.appendType(getReturnType())
node.appendAnnotations(this)
+ if (isVar()) {
+ node.append(DocumentationNode("var", Content.Empty, DocumentationNode.Kind.Modifier),
+ DocumentationReference.Kind.Detail)
+ }
getGetter()?.let {
if (!it.isDefault())
node.appendChild(it, DocumentationReference.Kind.Member)
diff --git a/src/Kotlin/KotlinLanguageService.kt b/src/Kotlin/KotlinLanguageService.kt
index 8795aba6..c273ff3d 100644
--- a/src/Kotlin/KotlinLanguageService.kt
+++ b/src/Kotlin/KotlinLanguageService.kt
@@ -108,7 +108,7 @@ class KotlinLanguageService : LanguageService {
private fun ContentNode.renderModifier(node: DocumentationNode) {
when (node.name) {
- "final", "internal" -> {}
+ "final", "internal", "var" -> {}
else -> {
keyword(node.name)
text(" ")
@@ -237,7 +237,7 @@ class KotlinLanguageService : LanguageService {
renderAnnotationsForNode(node)
when (node.kind) {
DocumentationNode.Kind.Property,
- DocumentationNode.Kind.ClassObjectProperty -> keyword("val ")
+ DocumentationNode.Kind.ClassObjectProperty -> keyword("${node.getPropertyKeyword()} ")
else -> throw IllegalArgumentException("Node $node is not a property")
}
renderTypeParametersForNode(node)
@@ -252,6 +252,9 @@ class KotlinLanguageService : LanguageService {
renderType(node.detail(DocumentationNode.Kind.Type))
}
+ fun DocumentationNode.getPropertyKeyword() =
+ if (details(DocumentationNode.Kind.Modifier).any { it.name == "var" }) "var" else "val"
+
fun ContentNode.identifierOrDeprecated(node: DocumentationNode) {
if (node.deprecation != null) {
val strike = ContentStrikethrough()