--- 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
| 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. |
| 969 | static 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 | |
| 975 | static void parse_kotlin_imports(CBMExtractCtx *ctx) { |
| 976 | TSTreeCursor cursor = ts_tree_cursor_new(ctx->root); |
no test coverage detected