aboutsummaryrefslogtreecommitdiff
path: root/src/Kotlin
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-05-29 13:52:43 +0200
committerDmitry Jemerov <yole@jetbrains.com>2015-05-29 13:52:43 +0200
commit64414ce984bc86e09b8724adbd01f1cb2646c17e (patch)
tree802710da5009b0b86519cc7cde9cdb6685cc7c99 /src/Kotlin
parent2fc80c4aae0d2957b34b176b9a2a48cb5089f41c (diff)
downloaddokka-64414ce984bc86e09b8724adbd01f1cb2646c17e.tar.gz
dokka-64414ce984bc86e09b8724adbd01f1cb2646c17e.tar.bz2
dokka-64414ce984bc86e09b8724adbd01f1cb2646c17e.zip
apply code cleanup; fix couple of deprecations manually
Diffstat (limited to 'src/Kotlin')
-rw-r--r--src/Kotlin/ContentBuilder.kt4
-rw-r--r--src/Kotlin/DocumentationBuilder.kt4
-rw-r--r--src/Kotlin/KotlinLanguageService.kt2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/Kotlin/ContentBuilder.kt b/src/Kotlin/ContentBuilder.kt
index 3dd5c00e..01feef34 100644
--- a/src/Kotlin/ContentBuilder.kt
+++ b/src/Kotlin/ContentBuilder.kt
@@ -138,14 +138,14 @@ fun DocumentationBuilder.functionBody(descriptor: DeclarationDescriptor, functio
is JetDeclarationWithBody -> ContentBlockCode().let() {
val bodyExpression = psiElement.getBodyExpression()
when (bodyExpression) {
- is JetBlockExpression -> bodyExpression.getText().trim("{", "}")
+ is JetBlockExpression -> bodyExpression.getText().removeSurrounding("{", "}")
else -> bodyExpression.getText()
}
}
else -> psiElement.getText()
}
- val lines = text.trimTrailing().split("\n").filterNot { it.length() == 0 }
+ val lines = text.trimEnd().split("\n".toRegex()).toTypedArray().filterNot { it.length() == 0 }
val indent = lines.map { it.takeWhile { it.isWhitespace() }.count() }.min() ?: 0
val finalText = lines.map { it.drop(indent) }.join("\n")
return ContentBlockCode("kotlin").let() { it.append(ContentText(finalText)); it }
diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt
index b1a5903e..4af53d88 100644
--- a/src/Kotlin/DocumentationBuilder.kt
+++ b/src/Kotlin/DocumentationBuilder.kt
@@ -96,7 +96,7 @@ class DocumentationBuilder(val resolutionFacade: ResolutionFacade,
}
val name = descriptor.getName().asString()
if (name == "equals" || name == "hashCode" || name == "toString") {
- var deepestDescriptor = descriptor: CallableMemberDescriptor
+ var deepestDescriptor: CallableMemberDescriptor = descriptor
while (!deepestDescriptor.getOverriddenDescriptors().isEmpty()) {
deepestDescriptor = deepestDescriptor.getOverriddenDescriptors().first()
}
@@ -203,7 +203,7 @@ class DocumentationBuilder(val resolutionFacade: ResolutionFacade,
return symbol
}
- fun KDocSection.getTags(): Array<KDocTag> = PsiTreeUtil.getChildrenOfType(this, javaClass<KDocTag>()) ?: array()
+ fun KDocSection.getTags(): Array<KDocTag> = PsiTreeUtil.getChildrenOfType(this, javaClass<KDocTag>()) ?: arrayOf()
private fun MutableContent.addTagToSeeAlso(descriptor: DeclarationDescriptor, seeTag: KDocTag) {
val subjectName = seeTag.getSubjectName()
diff --git a/src/Kotlin/KotlinLanguageService.kt b/src/Kotlin/KotlinLanguageService.kt
index 8809a630..75675c6f 100644
--- a/src/Kotlin/KotlinLanguageService.kt
+++ b/src/Kotlin/KotlinLanguageService.kt
@@ -56,7 +56,7 @@ class KotlinLanguageService : LanguageService {
renderItem(nodes.first())
nodes.drop(1).forEach {
if (noWrap) {
- symbol(separator.trimTrailing(" "))
+ symbol(separator.removeSuffix(" "))
nbsp()
} else {
symbol(separator)