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

Method normalize_fn_ref_value

codegraph-kernel/src/dart.rs:2382–2411  ·  view source on GitHub ↗

normalizeValue with DART_SPEC's one layer (`argument` → fan out). Named arguments are NOT captured (named_argument is not a layer).

(&mut self, v: Node<'t>, from: u32, depth: u32)

Source from the content-addressed store, hash-verified

2380 /// normalizeValue with DART_SPEC's one layer (`argument` → fan out).
2381 /// Named arguments are NOT captured (named_argument is not a layer).
2382 fn normalize_fn_ref_value(&mut self, v: Node<'t>, from: u32, depth: u32) {
2383 stack_guard!();
2384 if depth > 4 {
2385 return;
2386 }
2387 match v.kind() {
2388 "identifier" => {
2389 let name = self.text(v).to_string();
2390 if name.is_empty() || is_stoplisted(&name) {
2391 return;
2392 }
2393 let p = v.start_position();
2394 self.fn_ref_cands.push(Cand {
2395 from,
2396 name,
2397 line: p.row as u32 + 1,
2398 column_byte: v.start_byte(),
2399 row: p.row,
2400 });
2401 }
2402 "argument" => {
2403 let mut cursor = v.walk();
2404 let kids: Vec<Node<'t>> = v.named_children(&mut cursor).collect();
2405 for c in kids {
2406 self.normalize_fn_ref_value(c, from, depth + 1);
2407 }
2408 }
2409 _ => {}
2410 }
2411 }
2412
2413 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
2414 stack_guard!();

Callers 1

maybe_capture_fn_refsMethod · 0.45

Calls 5

pushMethod · 0.80
is_stoplistedFunction · 0.70
textMethod · 0.65
walkMethod · 0.45
collectMethod · 0.45

Tested by

no test coverage detected