aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
diff options
context:
space:
mode:
authorKrystian Ujma <krystianujma@gmail.com>2018-12-14 18:05:36 +0100
committerSimon Ogorodnik <simon.ogorodnik@gmail.com>2018-12-14 20:05:36 +0300
commit45187825aa63e5d1c3ac7fc3ae1b88aa34048812 (patch)
tree4364b3a98b98ce3660752289f5f30c15e1e0eacf /core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
parentb0310f8f3e242ffc64c56e8fd95710b25b37dfff (diff)
downloaddokka-45187825aa63e5d1c3ac7fc3ae1b88aa34048812.tar.gz
dokka-45187825aa63e5d1c3ac7fc3ae1b88aa34048812.tar.bz2
dokka-45187825aa63e5d1c3ac7fc3ae1b88aa34048812.zip
Modifiers sorted in wrong order #389
Fix #389 (modifiers sorted in wrong order)
Diffstat (limited to 'core/src/main/kotlin/Kotlin/DocumentationBuilder.kt')
-rw-r--r--core/src/main/kotlin/Kotlin/DocumentationBuilder.kt7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
index e15006cd..aa35634d 100644
--- a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
+++ b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
@@ -22,6 +22,7 @@ import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.psi.KtModifierListOwner
import org.jetbrains.kotlin.psi.KtParameter
+import org.jetbrains.kotlin.psi.addRemoveModifier.MODIFIERS_ORDER
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.constants.ConstantValue
import org.jetbrains.kotlin.resolve.descriptorUtil.*
@@ -332,7 +333,11 @@ class DocumentationBuilder
fun DocumentationNode.appendModifiers(descriptor: DeclarationDescriptor) {
val psi = (descriptor as DeclarationDescriptorWithSource).source.getPsi() as? KtModifierListOwner ?: return
- KtTokens.MODIFIER_KEYWORDS_ARRAY.filter { it !in knownModifiers }.forEach {
+ KtTokens.MODIFIER_KEYWORDS_ARRAY.filter {
+ it !in knownModifiers
+ }.sortedBy {
+ MODIFIERS_ORDER.indexOf(it)
+ }.forEach {
if (psi.hasModifier(it)) {
appendTextNode(it.value, NodeKind.Modifier)
}