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

Function find_source_node

src/pipeline/pass_parallel.c:2058–2076  ·  view source on GitHub ↗

Find the source node for an edge: enclosing function or file node. */

Source from the content-addressed store, hash-verified

2056
2057/* Find the source node for an edge: enclosing function or file node. */
2058static const cbm_gbuf_node_t *find_source_node(const cbm_gbuf_t *gbuf, const char *project,
2059 const char *rel, const char *enclosing_qn) {
2060 const cbm_gbuf_node_t *src = NULL;
2061 if (enclosing_qn) {
2062 src = cbm_gbuf_find_by_qn(gbuf, enclosing_qn);
2063 /* A class-level reference in a directory-module language carries the
2064 * DIRECTORY module QN, which hits the shared Folder/Project node —
2065 * attribute to this file's File node instead (#787). */
2066 if (cbm_pipeline_node_is_dir_container(src)) {
2067 src = NULL;
2068 }
2069 }
2070 if (!src) {
2071 char *file_qn = cbm_pipeline_fqn_compute(project, rel, "__file__");
2072 src = cbm_gbuf_find_by_qn(gbuf, file_qn);
2073 free(file_qn);
2074 }
2075 return src;
2076}
2077
2078/* Field type hint resolution for obj.Method() with multiple candidates.
2079 * Strips C# field prefixes (_ / m_), capitalizes to get type name, and

Callers 4

resolve_file_callsFunction · 0.85
resolve_file_usagesFunction · 0.85
resolve_file_throwsFunction · 0.85
resolve_file_rwFunction · 0.85

Calls 3

cbm_gbuf_find_by_qnFunction · 0.85
cbm_pipeline_fqn_computeFunction · 0.85

Tested by

no test coverage detected