JS/TS `export_statement` appears in import_node_types so re-exports (`export { X } from './m'`) are treated as an import boundary. But it also wraps exported *declarations* (`export function f(cfg: Config) {}`), and treating those as an import boundary wrongly suppresses USAGE edges for type references inside the exported declaration's signature. Return true when the node is an export that conta
| 2060 | // node is an export that contains a declaration child (i.e. NOT a bare re-export), |
| 2061 | // so the caller skips the import-scope push for it. |
| 2062 | static bool is_export_of_declaration(TSNode node) { |
| 2063 | if (strcmp(ts_node_type(node), "export_statement") != 0) { |
| 2064 | return false; |
| 2065 | } |
| 2066 | uint32_t n = ts_node_child_count(node); |
| 2067 | for (uint32_t i = 0; i < n; i++) { |
| 2068 | const char *ck = ts_node_type(ts_node_child(node, i)); |
| 2069 | if (strcmp(ck, "function_declaration") == 0 || strcmp(ck, "class_declaration") == 0 || |
| 2070 | strcmp(ck, "lexical_declaration") == 0 || |
| 2071 | strcmp(ck, "abstract_class_declaration") == 0 || |
| 2072 | strcmp(ck, "interface_declaration") == 0 || strcmp(ck, "enum_declaration") == 0 || |
| 2073 | strcmp(ck, "type_alias_declaration") == 0 || strcmp(ck, "variable_declaration") == 0 || |
| 2074 | strcmp(ck, "generator_function_declaration") == 0) { |
| 2075 | return true; |
| 2076 | } |
| 2077 | } |
| 2078 | return false; |
| 2079 | } |
| 2080 | |
| 2081 | // Some languages encode imports with the same generic AST node used by every |
| 2082 | // ordinary invocation. Static node-kind membership is therefore not enough to |
no outgoing calls
no test coverage detected