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

Method extract_rust_macro_refs

codegraph-kernel/src/rustlang.rs:1048–1061  ·  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

1046 /// extractor names them (rust_macro_arg_refs). Mirrors
1047 /// rust-macro-calls.ts byte-for-byte — change both.
1048 fn extract_rust_macro_refs(&mut self, node: Node<'t>) {
1049 if self.stack.is_empty() {
1050 return;
1051 }
1052 let refs = rust_macro_arg_refs(node, self.src);
1053 if refs.is_empty() {
1054 return;
1055 }
1056 let from = self.top_row();
1057 for r in refs {
1058 let kind = edge_kind_index(r.kind).unwrap();
1059 self.push_ref_at(from, &r.name, kind, r.at);
1060 }
1061 }
1062
1063 /// extractRustRouteMacro — body-walker-only; bare `routes`/`catchers`
1064 /// 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