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

Function parse_php_imports

internal/cbm/extract_imports.c:1820–1839  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1818}
1819
1820static void parse_php_imports(CBMExtractCtx *ctx) {
1821 TSTreeCursor cursor = ts_tree_cursor_new(ctx->root);
1822 if (!ts_tree_cursor_goto_first_child(&cursor)) {
1823 ts_tree_cursor_delete(&cursor);
1824 return;
1825 }
1826 do {
1827 TSNode node = ts_tree_cursor_current_node(&cursor);
1828 const char *kind = ts_node_type(node);
1829 if (strcmp(kind, "namespace_use_declaration") == 0) {
1830 emit_php_use_decl(ctx, node);
1831 } else if (strcmp(kind, "expression_statement") == 0) {
1832 // require / include / require_once / include_once
1833 if (!try_generic_path_fields(ctx, node)) {
1834 generic_import_from_text(ctx, node);
1835 }
1836 }
1837 } while (ts_tree_cursor_goto_next_sibling(&cursor));
1838 ts_tree_cursor_delete(&cursor);
1839}
1840
1841// --- C# imports ---
1842// tree-sitter-c-sharp models `using System.Text;` as a `using_directive`.

Callers 1

cbm_extract_importsFunction · 0.85

Calls 3

emit_php_use_declFunction · 0.85
try_generic_path_fieldsFunction · 0.85
generic_import_from_textFunction · 0.85

Tested by

no test coverage detected