fun findKey()

in remote-robot/src/main/kotlin/com/intellij/remoterobot/fixtures/dataExtractor/server/TextToKeyCache.kt [52:63]


    fun findKey(text: String): String? {
        var key: Set<String>? = textToKeyMap[text]
        if (key == null && text.endsWith("...")) {
            synchronized(textToKeyMap) {
                key = textToKeyMap[textToKeyMap.keys.firstOrNull { it.startsWith(text.split("...")[0]) }]
            }
        }
        if (key == null && text.contains("(")) {
            key = textToKeyMap[text.split("(")[0].trim()]
        }
        return key?.joinToString(" ") { it }
    }