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

Method normalize_fn_ref_value

codegraph-kernel/src/lua.rs:752–780  ·  view source on GitHub ↗

normalizeValue with LUA_SPEC's one transparent layer (expression_list fans out to named children).

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

Source from the content-addressed store, hash-verified

750 /// normalizeValue with LUA_SPEC's one transparent layer (expression_list
751 /// fans out to named children).
752 fn normalize_fn_ref_value(&mut self, v: Node<'t>, from: u32, depth: u32) {
753 if depth > 4 {
754 return;
755 }
756 match v.kind() {
757 "identifier" => {
758 let name = self.text(v).to_string();
759 if name.is_empty() || is_stoplisted(&name) {
760 return;
761 }
762 let p = v.start_position();
763 self.fn_ref_cands.push(Cand {
764 from,
765 name,
766 line: p.row as u32 + 1,
767 column_byte: v.start_byte(),
768 row: p.row,
769 });
770 }
771 "expression_list" => {
772 let mut cursor = v.walk();
773 let kids: Vec<Node<'t>> = v.named_children(&mut cursor).collect();
774 for c in kids {
775 self.normalize_fn_ref_value(c, from, depth + 1);
776 }
777 }
778 _ => {}
779 }
780 }
781
782 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
783 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