aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin
diff options
context:
space:
mode:
authorKrystian Ujma <krystianujma@gmail.com>2019-02-15 14:10:27 +0100
committerSimon Ogorodnik <simon.ogorodnik@gmail.com>2019-02-15 16:10:27 +0300
commit5afb808f984542bb550d124f87c65c71a9148b83 (patch)
tree50eabe4caf34e0415f7396dd8809f6bf4be6a51a /core/src/main/kotlin
parentc6da6b752c698085d176acc5b75cb14abcc32f80 (diff)
downloaddokka-5afb808f984542bb550d124f87c65c71a9148b83.tar.gz
dokka-5afb808f984542bb550d124f87c65c71a9148b83.tar.bz2
dokka-5afb808f984542bb550d124f87c65c71a9148b83.zip
Nullable left off function type parameter with default value (#401) (#328)
Diffstat (limited to 'core/src/main/kotlin')
-rw-r--r--core/src/main/kotlin/Kotlin/KotlinLanguageService.kt16
1 files changed, 13 insertions, 3 deletions
diff --git a/core/src/main/kotlin/Kotlin/KotlinLanguageService.kt b/core/src/main/kotlin/Kotlin/KotlinLanguageService.kt
index f57708ed..5f43c22e 100644
--- a/core/src/main/kotlin/Kotlin/KotlinLanguageService.kt
+++ b/core/src/main/kotlin/Kotlin/KotlinLanguageService.kt
@@ -166,8 +166,18 @@ class KotlinLanguageService : CommonLanguageService() {
keyword("dynamic")
return
}
+
+ val nullabilityModifier = node.detailOrNull(NodeKind.NullabilityModifier)
+
if (node.isFunctionalType()) {
- renderFunctionalType(node, renderMode)
+ if (nullabilityModifier != null) {
+ symbol("(")
+ renderFunctionalType(node, renderMode)
+ symbol(")")
+ symbol(nullabilityModifier.name)
+ } else {
+ renderFunctionalType(node, renderMode)
+ }
return
}
if (renderMode == RenderMode.FULL) {
@@ -185,8 +195,8 @@ class KotlinLanguageService : CommonLanguageService() {
}
symbol(">")
}
- val nullabilityModifier = node.details(NodeKind.NullabilityModifier).singleOrNull()
- if (nullabilityModifier != null) {
+
+ nullabilityModifier ?.apply {
symbol(nullabilityModifier.name)
}
}