aboutsummaryrefslogtreecommitdiff
path: root/src/Kotlin/KotlinLanguageService.kt
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-01-14 14:00:55 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-01-14 14:00:55 +0100
commitfaad901ed29f802d7b304c06ae62954b149960e7 (patch)
tree6af5015bf1d03fc051678e58bfb81580bd9bcc68 /src/Kotlin/KotlinLanguageService.kt
parentcd21e1fea43c0b7fa8013e3db7f49fe2b600b7f8 (diff)
downloaddokka-faad901ed29f802d7b304c06ae62954b149960e7.tar.gz
dokka-faad901ed29f802d7b304c06ae62954b149960e7.tar.bz2
dokka-faad901ed29f802d7b304c06ae62954b149960e7.zip
correcty distinguish 'val' and 'var' properties
Diffstat (limited to 'src/Kotlin/KotlinLanguageService.kt')
-rw-r--r--src/Kotlin/KotlinLanguageService.kt7
1 files changed, 5 insertions, 2 deletions
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()