mirror of
https://github.com/safishamsi/graphify.git
synced 2026-07-13 10:57:13 +00:00
00dd978d17
Kotlin enum entries weren't extracted: the walker never descended into the enum body (`enum_class_body` wasn't in _KOTLIN_CONFIG.body_fallback_child_types, so _find_body returned None). Add `enum_class_body` to the fallback body types and a `_kotlin_extra_walk` (dispatched for tree_sitter_kotlin, mirroring the Java/Swift handling) that emits each enum_entry as a node with a `case_of` edge to the enum. Re-applied from PR #1738 (@ivanzhl) onto the post-#1737 module layout: the walk engine now lives in graphify/extractors/engine.py while _KOTLIN_CONFIG stays in extract.py. Closes the Kotlin half of #1700 (Java was #1719). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
50 lines
1018 B
Kotlin
50 lines
1018 B
Kotlin
import kotlinx.coroutines.delay
|
|
import kotlin.math.max
|
|
|
|
data class Config(val baseUrl: String, val timeout: Int)
|
|
|
|
class HttpClient(private val config: Config) {
|
|
fun get(path: String): String {
|
|
return buildRequest("GET", path)
|
|
}
|
|
|
|
fun post(path: String, body: String): String {
|
|
return buildRequest("POST", path)
|
|
}
|
|
|
|
private fun buildRequest(method: String, path: String): String {
|
|
return "$method ${config.baseUrl}$path"
|
|
}
|
|
}
|
|
|
|
interface Loggable {
|
|
fun log()
|
|
}
|
|
|
|
open class BaseProcessor
|
|
|
|
class Result<T>
|
|
|
|
class DataProcessor : BaseProcessor(), Loggable {
|
|
var current: Result<DataProcessor> = Result()
|
|
|
|
fun run(input: DataProcessor): Result<DataProcessor> {
|
|
return current
|
|
}
|
|
|
|
override fun log() {}
|
|
}
|
|
|
|
class LoggingList<T>(inner: MutableList<T>) : MutableList<T> by inner
|
|
|
|
fun createClient(baseUrl: String): HttpClient {
|
|
val config = Config(baseUrl, 30)
|
|
return HttpClient(config)
|
|
}
|
|
|
|
enum class ChatType {
|
|
NORMAL,
|
|
GROUP,
|
|
SYSTEM
|
|
}
|