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

Method normalize_fn_ref_value

codegraph-kernel/src/go.rs:982–1010  ·  view source on GitHub ↗

normalizeValue with GO_SPEC's transparent layers (literal_element, expression_list — both fan out to named children).

(&mut self, v: Node<'t>, from: u32, depth: u32)

Source from the content-addressed store, hash-verified

980 /// normalizeValue with GO_SPEC's transparent layers (literal_element,
981 /// expression_list — both fan out to named children).
982 fn normalize_fn_ref_value(&mut self, v: Node<'t>, from: u32, depth: u32) {
983 if depth > 4 {
984 return;
985 }
986 match v.kind() {
987 "identifier" => {
988 let name = self.text(v).to_string();
989 if name.is_empty() || is_stoplisted(&name) {
990 return;
991 }
992 let p = v.start_position();
993 self.fn_ref_cands.push(Cand {
994 from,
995 name,
996 line: p.row as u32 + 1,
997 column_byte: v.start_byte(),
998 row: p.row,
999 });
1000 }
1001 "literal_element" | "expression_list" => {
1002 for i in 0..v.named_child_count() {
1003 if let Some(c) = v.named_child(i) {
1004 self.normalize_fn_ref_value(c, from, depth + 1);
1005 }
1006 }
1007 }
1008 _ => {}
1009 }
1010 }
1011
1012 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
1013 if depth > 12 {

Callers 1

maybe_capture_fn_refsMethod · 0.45

Calls 2

is_stoplistedFunction · 0.70
textMethod · 0.45

Tested by

no test coverage detected