aboutsummaryrefslogtreecommitdiff
path: root/src/Kotlin
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-02-26 16:56:16 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-02-26 16:56:16 +0100
commitf8704c63e7ba267beb9370bc22ff96dde75b0f9f (patch)
tree19a6a5ae441a32b8be3140e778ea71443908aa4c /src/Kotlin
parent9829559af837927b25c8dcc207e58806fab7832f (diff)
downloaddokka-f8704c63e7ba267beb9370bc22ff96dde75b0f9f.tar.gz
dokka-f8704c63e7ba267beb9370bc22ff96dde75b0f9f.tar.bz2
dokka-f8704c63e7ba267beb9370bc22ff96dde75b0f9f.zip
variance modifiers for type parameters are separate modifier nodes, not part of the type name
Diffstat (limited to 'src/Kotlin')
-rw-r--r--src/Kotlin/DocumentationBuilder.kt9
-rw-r--r--src/Kotlin/KotlinLanguageService.kt9
2 files changed, 14 insertions, 4 deletions
diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt
index 6ce7727c..7804fd72 100644
--- a/src/Kotlin/DocumentationBuilder.kt
+++ b/src/Kotlin/DocumentationBuilder.kt
@@ -474,12 +474,15 @@ class DocumentationBuilder(val session: ResolveSession,
val doc = parseDocumentation(this)
val name = getName().asString()
val prefix = when (getVariance()) {
- Variance.IN_VARIANCE -> "in "
- Variance.OUT_VARIANCE -> "out "
+ Variance.IN_VARIANCE -> "in"
+ Variance.OUT_VARIANCE -> "out"
else -> ""
}
- val node = DocumentationNode(prefix + name, doc, DocumentationNode.Kind.TypeParameter)
+ val node = DocumentationNode(name, doc, DocumentationNode.Kind.TypeParameter)
+ if (prefix != "") {
+ node.appendTextNode(prefix, Kind.Modifier)
+ }
val builtIns = KotlinBuiltIns.getInstance()
for (constraint in getUpperBounds()) {
diff --git a/src/Kotlin/KotlinLanguageService.kt b/src/Kotlin/KotlinLanguageService.kt
index 435fbc64..a4f62c3f 100644
--- a/src/Kotlin/KotlinLanguageService.kt
+++ b/src/Kotlin/KotlinLanguageService.kt
@@ -125,8 +125,15 @@ class KotlinLanguageService : LanguageService {
}
private fun ContentBlock.renderTypeParameter(node: DocumentationNode) {
- val constraints = node.details(DocumentationNode.Kind.UpperBound)
+ val modifier = node.details(DocumentationNode.Kind.Modifier).singleOrNull()
+ if (modifier != null) {
+ keyword(modifier.name)
+ nbsp()
+ }
+
identifier(node.name)
+
+ val constraints = node.details(DocumentationNode.Kind.UpperBound)
if (constraints.any()) {
nbsp()
symbol(":")