fun suggestForPartial()

in src/main/kotlin/jetbrains/buildServer/server/querylang/autocompl/Completer.kt [92:111]


    fun suggestForPartial(input: String, trace: List<String>, word: String): List<CompletionResult> {
        if (trace.isEmpty()) {
            return emptyList()
        }
        var node = trace[0]

        graph[node] ?: return emptyList()

        trace.drop(1).forEach { filterName ->
            if (filterName !in graph[node]!!.toFullStringList()) {
                return emptyList()
            }
            node = filterName
        }

        if (graph.contains(node)) {
            return graph[node]!!.toStringList().filterBegins(word).toCompletionResult(input)
        }
        return emptyList()
    }