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

Method normalize_fn_ref_value

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

2401 /// normalizeValue with DART_SPEC's one layer (`argument` → fan out).
2402 /// Named arguments are NOT captured (named_argument is not a layer).
2403 fn normalize_fn_ref_value(&mut self, v: Node<'t>, from: u32, depth: u32) {
2404 stack_guard!();
2405 if depth > 4 {
2406 return;
2407 }
2408 match v.kind() {
2409 "identifier" => {
2410 let name = self.text(v).to_string();
2411 if name.is_empty() || is_stoplisted(&name) {
2412 return;
2413 }
2414 let p = v.start_position();
2415 self.fn_ref_cands.push(Cand {
2416 from,
2417 name,
2418 line: p.row as u32 + 1,
2419 column_byte: v.start_byte(),
2420 row: p.row,
2421 });
2422 }
2423 "argument" => {
2424 let mut cursor = v.walk();
2425 let kids: Vec<Node<'t>> = v.named_children(&mut cursor).collect();
2426 for c in kids {
2427 self.normalize_fn_ref_value(c, from, depth + 1);
2428 }
2429 }
2430 _ => {}
2431 }
2432 }
2433
2434 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
2435 stack_guard!();

Callers 1

maybe_capture_fn_refsMethod · 0.45

Calls 5

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

Tested by

no test coverage detected