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

Method normalize_fn_ref_value

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

1354 /// normalizeValue with DART_SPEC's one layer (`argument` → fan out).
1355 /// Named arguments are NOT captured (named_argument is not a layer).
1356 fn normalize_fn_ref_value(&mut self, v: Node<'t>, from: u32, depth: u32) {
1357 stack_guard!();
1358 if depth > 4 {
1359 return;
1360 }
1361 match v.kind() {
1362 "identifier" => {
1363 let name = self.text(v).to_string();
1364 if name.is_empty() || is_stoplisted(&name) {
1365 return;
1366 }
1367 let p = v.start_position();
1368 self.fn_ref_cands.push(Cand {
1369 from,
1370 name,
1371 line: p.row as u32 + 1,
1372 column_byte: v.start_byte(),
1373 row: p.row,
1374 });
1375 }
1376 "argument" => {
1377 let mut cursor = v.walk();
1378 let kids: Vec<Node<'t>> = v.named_children(&mut cursor).collect();
1379 for c in kids {
1380 self.normalize_fn_ref_value(c, from, depth + 1);
1381 }
1382 }
1383 _ => {}
1384 }
1385 }
1386
1387 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
1388 stack_guard!();

Callers 1

maybe_capture_fn_refsMethod · 0.45

Calls 3

is_stoplistedFunction · 0.70
textMethod · 0.65
collectMethod · 0.45

Tested by

no test coverage detected