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

Method normalize_fn_ref_value

codegraph-kernel/src/dart.rs:2389–2418  ·  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

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