aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Samples/KotlinWebsiteSampleProcessingService.kt
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-02-07 15:48:30 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-02-07 15:48:30 +0300
commitcf4bb4673730cc0787784380fc986efec8f8e9fb (patch)
tree223dbbd5dfb2ef459ccbabb5a39418d65bedda9a /core/src/main/kotlin/Samples/KotlinWebsiteSampleProcessingService.kt
parentf4f7642c90fef06f04cadc57835ed431ace69802 (diff)
downloaddokka-cf4bb4673730cc0787784380fc986efec8f8e9fb.tar.gz
dokka-cf4bb4673730cc0787784380fc986efec8f8e9fb.tar.bz2
dokka-cf4bb4673730cc0787784380fc986efec8f8e9fb.zip
KT-16197 WebDemo: No empty strings
#KT-16197 fixed
Diffstat (limited to 'core/src/main/kotlin/Samples/KotlinWebsiteSampleProcessingService.kt')
-rw-r--r--core/src/main/kotlin/Samples/KotlinWebsiteSampleProcessingService.kt14
1 files changed, 6 insertions, 8 deletions
diff --git a/core/src/main/kotlin/Samples/KotlinWebsiteSampleProcessingService.kt b/core/src/main/kotlin/Samples/KotlinWebsiteSampleProcessingService.kt
index baf44904..864033f0 100644
--- a/core/src/main/kotlin/Samples/KotlinWebsiteSampleProcessingService.kt
+++ b/core/src/main/kotlin/Samples/KotlinWebsiteSampleProcessingService.kt
@@ -2,6 +2,7 @@ package org.jetbrains.dokka.Samples
import com.google.inject.Inject
import com.intellij.psi.PsiElement
+import com.intellij.psi.impl.source.tree.LeafPsiElement
import org.jetbrains.dokka.*
import org.jetbrains.kotlin.psi.*
import org.jetbrains.kotlin.resolve.ImportPath
@@ -12,7 +13,7 @@ open class KotlinWebsiteSampleProcessingService
resolutionFacade: DokkaResolutionFacade)
: DefaultSampleProcessingService(options, logger, resolutionFacade) {
- private class SampleBuilder() : KtVisitorVoid() {
+ private class SampleBuilder : KtTreeVisitorVoid() {
val builder = StringBuilder()
val text: String
get() = builder.toString()
@@ -48,13 +49,10 @@ open class KotlinWebsiteSampleProcessingService
}
}
- override fun visitElement(element: PsiElement?) {
- if (element != null) {
- if (element.children.isEmpty())
- builder.append(element.text)
- else
- element.acceptChildren(this)
- }
+ override fun visitElement(element: PsiElement) {
+ if (element is LeafPsiElement)
+ builder.append(element.text)
+ super.visitElement(element)
}
}