MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / emit_re_export_refs

Method emit_re_export_refs

codegraph-kernel/src/tsjs/extractors.rs:2133–2152  ·  view source on GitHub ↗
(&mut self, node: Node<'t>)

Source from the content-addressed store, hash-verified

2131 }
2132
2133 pub(super) fn emit_re_export_refs(&mut self, node: Node<'t>) {
2134 let from_row = self.top_row();
2135 let clause = (0..node.named_child_count())
2136 .filter_map(|i| node.named_child(i))
2137 .find(|c| c.kind() == "export_clause");
2138 let Some(clause) = clause else { return }; // `export * from './y'`
2139 let imports_kind = edge_kind_index("imports").unwrap();
2140 for spec in clause.named_children(&mut clause.walk()) {
2141 if spec.kind() != "export_specifier" {
2142 continue;
2143 }
2144 let name_node = spec.child_by_field_name("name").or_else(|| spec.named_child(0));
2145 let Some(n) = name_node else { continue };
2146 let name = self.text(n).to_string();
2147 if name.is_empty() || name == "default" {
2148 continue;
2149 }
2150 self.push_ref(from_row, &name, imports_kind, n);
2151 }
2152 }
2153
2154 // --- extractCall (TS/JS generic tail) -------------------------------------------------
2155

Callers 1

visit_nodeMethod · 0.80

Calls 6

edge_kind_indexFunction · 0.85
textMethod · 0.65
unwrapMethod · 0.60
top_rowMethod · 0.45
walkMethod · 0.45
push_refMethod · 0.45

Tested by

no test coverage detected