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)
| 987 | /// normalizeValue with GO_SPEC's transparent layers (literal_element, |
| 988 | /// expression_list — both fan out to named children). |
| 989 | fn normalize_fn_ref_value(&mut self, v: Node<'t>, from: u32, depth: u32) { |
| 990 | stack_guard!(); |
| 991 | if depth > 4 { |
| 992 | return; |
| 993 | } |
| 994 | match v.kind() { |
| 995 | "identifier" => { |
| 996 | let name = self.text(v).to_string(); |
| 997 | if name.is_empty() || is_stoplisted(&name) { |
| 998 | return; |
| 999 | } |
| 1000 | let p = v.start_position(); |
| 1001 | self.fn_ref_cands.push(Cand { |
| 1002 | from, |
| 1003 | name, |
| 1004 | line: p.row as u32 + 1, |
| 1005 | column_byte: v.start_byte(), |
| 1006 | row: p.row, |
| 1007 | }); |
| 1008 | } |
| 1009 | "literal_element" | "expression_list" => { |
| 1010 | for i in 0..v.named_child_count() { |
| 1011 | if let Some(c) = v.named_child(i) { |
| 1012 | self.normalize_fn_ref_value(c, from, depth + 1); |
| 1013 | } |
| 1014 | } |
| 1015 | } |
| 1016 | _ => {} |
| 1017 | } |
| 1018 | } |
| 1019 | |
| 1020 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) { |
| 1021 | stack_guard!(); |
no test coverage detected