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:
Adam Malek
2022-04-26 11:37:08 +00:00
committed by intellij-monorepo-bot
parent 061b79af90
commit 1c4fb5cd4a
@@ -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