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

Function is_inside_import

internal/cbm/extract_usages.c:32–46  ·  view source on GitHub ↗

Check if a node is inside an import statement

Source from the content-addressed store, hash-verified

30
31// Check if a node is inside an import statement
32static bool is_inside_import(TSNode node, const CBMLangSpec *spec) {
33 if (!spec->import_node_types || !spec->import_node_types[0]) {
34 return false;
35 }
36 TSNode cur = ts_node_parent(node);
37 int depth = 0;
38 while (!ts_node_is_null(cur) && depth < MAX_PARENT_DEPTH) {
39 if (cbm_kind_in_set(cur, spec->import_node_types)) {
40 return true;
41 }
42 cur = ts_node_parent(cur);
43 depth++;
44 }
45 return false;
46}
47
48// Is this an identifier-like node that represents a reference?
49static bool is_reference_node(TSNode node, CBMLanguage lang) {

Callers 1

try_emit_usageFunction · 0.85

Calls 1

cbm_kind_in_setFunction · 0.85

Tested by

no test coverage detected