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

Method emit_re_export_refs

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

Source from the content-addressed store, hash-verified

1011 }
1012
1013 pub(super) fn emit_re_export_refs(&mut self, node: Node<'t>) {
1014 let from_row = self.top_row();
1015 let clause = (0..node.named_child_count())
1016 .filter_map(|i| node.named_child(i))
1017 .find(|c| c.kind() == "export_clause");
1018 let Some(clause) = clause else { return }; // `export * from './y'`
1019 let imports_kind = edge_kind_index("imports").unwrap();
1020 for i in 0..clause.named_child_count() {
1021 let Some(spec) = clause.named_child(i) else { continue };
1022 if spec.kind() != "export_specifier" {
1023 continue;
1024 }
1025 let name_node = spec.child_by_field_name("name").or_else(|| spec.named_child(0));
1026 let Some(n) = name_node else { continue };
1027 let name = self.text(n).to_string();
1028 if name.is_empty() || name == "default" {
1029 continue;
1030 }
1031 self.push_ref(from_row, &name, imports_kind, n);
1032 }
1033 }
1034
1035 // --- extractCall (TS/JS generic tail) -------------------------------------------------
1036

Callers 1

visit_nodeMethod · 0.80

Calls 5

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

Tested by

no test coverage detected