aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/utils
diff options
context:
space:
mode:
authorilya-g <ilya.gorbunov@jetbrains.com>2023-02-17 16:42:28 +0100
committerGitHub <noreply@github.com>2023-02-17 16:42:28 +0100
commit1fd045904e94d68878b3a5f748bf20f7c61a1cf7 (patch)
tree6e5e63033f654abc4e5c61278a4eeb39330977be /plugins/base/src/main/kotlin/utils
parentdaed35f92b3b482688856d139da6849c8e6b4ab1 (diff)
downloaddokka-1fd045904e94d68878b3a5f748bf20f7c61a1cf7.tar.gz
dokka-1fd045904e94d68878b3a5f748bf20f7c61a1cf7.tar.bz2
dokka-1fd045904e94d68878b3a5f748bf20f7c61a1cf7.zip
Consistent alphabetical order of element groups in index and navigation (#2861)
* Sort groups of divergent elements by their key first ignoring case, then preserving it * Add tests for sorting groups and navigation
Diffstat (limited to 'plugins/base/src/main/kotlin/utils')
-rw-r--r--plugins/base/src/main/kotlin/utils/alphabeticalOrder.kt7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/base/src/main/kotlin/utils/alphabeticalOrder.kt b/plugins/base/src/main/kotlin/utils/alphabeticalOrder.kt
new file mode 100644
index 00000000..68b9cde8
--- /dev/null
+++ b/plugins/base/src/main/kotlin/utils/alphabeticalOrder.kt
@@ -0,0 +1,7 @@
+package org.jetbrains.dokka.base.utils
+
+
+/**
+ * Canonical alphabetical order to sort named elements
+ */
+internal val canonicalAlphabeticalOrder: Comparator<in String> = String.CASE_INSENSITIVE_ORDER.thenBy { it } \ No newline at end of file