mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
ML in SE: Make isCamelCase feature be true for any case change
Previously, it wouldn't work for cases when the last character would be upper case, e.g fooB. Now, any case change is detected. GitOrigin-RevId: ca4a7c3d225a0aa78f797097af051a06fbde6766
This commit is contained in:
committed by
intellij-monorepo-bot
parent
061b79af90
commit
1c4fb5cd4a
+4
-3
@@ -44,9 +44,10 @@ class SearchEverywhereStateFeaturesProvider {
|
||||
|
||||
private fun CharSequence.isCamelCase(): Boolean {
|
||||
this.forEachIndexed { index, c ->
|
||||
if (index > 0 && c.isLowerCase() && this[index - 1].isUpperCase()) {
|
||||
return true
|
||||
}
|
||||
if (index == 0) return@forEachIndexed
|
||||
|
||||
// Check if there's a case change between this character and the previous one
|
||||
if (c.isUpperCase() != this[index - 1].isUpperCase()) return true
|
||||
}
|
||||
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user