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

Method extract_rust_macro_refs

codegraph-kernel/src/rustlang.rs:1064–1077  ·  view source on GitHub ↗

extractRustMacroCalls (#3251): the calls and variant paths in the arguments of an expression macro (`format!`, `assert_eq!`, `vec!`, `write!`, `matches!`, `json!`), read from its token tree as the call extractor names them (rust_macro_arg_refs). Mirrors rust-macro-calls.ts byte-for-byte — change both.

(&mut self, node: Node<'t>)

Source from the content-addressed store, hash-verified

1062 /// extractor names them (rust_macro_arg_refs). Mirrors
1063 /// rust-macro-calls.ts byte-for-byte — change both.
1064 fn extract_rust_macro_refs(&mut self, node: Node<'t>) {
1065 if self.stack.is_empty() {
1066 return;
1067 }
1068 let refs = rust_macro_arg_refs(node, self.src);
1069 if refs.is_empty() {
1070 return;
1071 }
1072 let from = self.top_row();
1073 for r in refs {
1074 let kind = edge_kind_index(r.kind).unwrap();
1075 self.push_ref_at(from, &r.name, kind, r.at);
1076 }
1077 }
1078
1079 /// extractRustRouteMacro — body-walker-only; bare `routes`/`catchers`
1080 /// identifiers only (`rocket::routes![…]` is skipped); identifier runs in

Callers 1

Calls 5

rust_macro_arg_refsFunction · 0.85
edge_kind_indexFunction · 0.85
unwrapMethod · 0.60
top_rowMethod · 0.45
push_ref_atMethod · 0.45

Tested by

no test coverage detected