MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / java_lookup_method

Function java_lookup_method

internal/cbm/lsp/java_lsp.c:944–970  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

942/* ── Method lookup ────────────────────────────────────────────────── */
943
944const CBMRegisteredFunc *java_lookup_method(JavaLSPContext *ctx, const char *class_qn,
945 const char *method_name, int arg_count) {
946 if (!class_qn || !method_name)
947 return NULL;
948 const char *cur = class_qn;
949 const CBMRegisteredFunc *fallback = NULL;
950 for (int hops = 0; hops < JAVA_LSP_MAX_INHERIT_HOPS && cur; hops++) {
951 /* Try arg-count-aware lookup first. */
952 const CBMRegisteredFunc *m =
953 cbm_registry_lookup_method_by_args(ctx->registry, cur, method_name, arg_count);
954 if (m)
955 return m;
956 /* Otherwise capture any name match as fallback. */
957 if (!fallback) {
958 fallback = cbm_registry_lookup_method(ctx->registry, cur, method_name);
959 }
960 const CBMRegisteredType *rt = cbm_registry_lookup_type(ctx->registry, cur);
961 if (!rt)
962 break;
963 if (rt->embedded_types && rt->embedded_types[0]) {
964 cur = rt->embedded_types[0];
965 } else {
966 cur = NULL;
967 }
968 }
969 return fallback;
970}
971
972/* ── Method-invocation evaluation ─────────────────────────────────── */
973

Callers 4

eval_method_invocationFunction · 0.85
resolve_method_callFunction · 0.85
resolve_method_referenceFunction · 0.85
lookup_method_for_callFunction · 0.85

Tested by

no test coverage detected