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

Method normalize_fn_ref_value

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

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

Callers 1

maybe_capture_fn_refsMethod · 0.45

Calls 3

is_stoplistedFunction · 0.70
textMethod · 0.45
collectMethod · 0.45

Tested by

no test coverage detected