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

Function extract_one_import_header

internal/cbm/extract_imports.c:969–973  ·  view source on GitHub ↗

--- Kotlin imports --- tree-sitter-kotlin nests imports: source_file -> import_list -> import_header*. parse_generic_imports only scans the DIRECT children of root, and "import" is the keyword token (anon_sym_import), not a statement node — so a generic match on "import" finds nothing. Descend into import_list (and accept a bare import_header for grammar variants) and reuse the generic path extra

Source from the content-addressed store, hash-verified

967// match on "import" finds nothing. Descend into import_list (and accept a bare
968// import_header for grammar variants) and reuse the generic path extractors.
969static void extract_one_import_header(CBMExtractCtx *ctx, TSNode header) {
970 if (!try_generic_path_fields(ctx, header)) {
971 generic_import_from_text(ctx, header);
972 }
973}
974
975static void parse_kotlin_imports(CBMExtractCtx *ctx) {
976 TSTreeCursor cursor = ts_tree_cursor_new(ctx->root);

Callers 2

parse_kotlin_importsFunction · 0.85
parse_haskell_importsFunction · 0.85

Calls 2

try_generic_path_fieldsFunction · 0.85
generic_import_from_textFunction · 0.85

Tested by

no test coverage detected