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

Function find_es_source_node

internal/cbm/extract_imports.c:839–852  ·  view source on GitHub ↗

Find the source string node in an ES import_statement.

Source from the content-addressed store, hash-verified

837
838// Find the source string node in an ES import_statement.
839static TSNode find_es_source_node(TSNode node) {
840 TSNode source_node = ts_node_child_by_field_name(node, TS_FIELD("source"));
841 if (ts_node_is_null(source_node)) {
842 uint32_t nc = ts_node_child_count(node);
843 for (int j = (int)nc - SKIP_ONE; j >= 0; j--) {
844 TSNode c = ts_node_child(node, (uint32_t)j);
845 const char *ck = ts_node_type(c);
846 if (strcmp(ck, "string") == 0 || strcmp(ck, "string_literal") == 0) {
847 return c;
848 }
849 }
850 }
851 return source_node;
852}
853
854// Process named_imports: import {A, B as C} from "path".
855static bool process_named_imports(CBMExtractCtx *ctx, TSNode sub, const char *path) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected