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

Method normalize_fn_ref_value

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

1983 /// normalizeValue with DART_SPEC's one layer (`argument` → fan out).
1984 /// Named arguments are NOT captured (named_argument is not a layer).
1985 fn normalize_fn_ref_value(&mut self, v: Node<'t>, from: u32, depth: u32) {
1986 stack_guard!();
1987 if depth > 4 {
1988 return;
1989 }
1990 match v.kind() {
1991 "identifier" => {
1992 let name = self.text(v).to_string();
1993 if name.is_empty() || is_stoplisted(&name) {
1994 return;
1995 }
1996 let p = v.start_position();
1997 self.fn_ref_cands.push(Cand {
1998 from,
1999 name,
2000 line: p.row as u32 + 1,
2001 column_byte: v.start_byte(),
2002 row: p.row,
2003 });
2004 }
2005 "argument" => {
2006 let mut cursor = v.walk();
2007 let kids: Vec<Node<'t>> = v.named_children(&mut cursor).collect();
2008 for c in kids {
2009 self.normalize_fn_ref_value(c, from, depth + 1);
2010 }
2011 }
2012 _ => {}
2013 }
2014 }
2015
2016 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
2017 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