(&mut self)
| 961 | } |
| 962 | |
| 963 | fn flush_fn_ref_candidates(&mut self) { |
| 964 | let cands = std::mem::take(&mut self.fn_ref_cands); |
| 965 | if cands.is_empty() || util::is_generated_file(self.file_path) { |
| 966 | return; |
| 967 | } |
| 968 | let mut seen: HashSet<(String, String)> = HashSet::new(); |
| 969 | for c in cands { |
| 970 | // `this.`-prefixed candidates always flush (class-scoped resolver); |
| 971 | // bare `method(:x)` names gate on defined-in-file ∪ imports (ruby's |
| 972 | // path-shaped imports match neither name regex, so effectively |
| 973 | // defined-in-file). |
| 974 | if !c.name.starts_with("this.") |
| 975 | && !c.name.contains("::") |
| 976 | && !self.defined_fn_names.contains(&c.name) |
| 977 | && !self.imported_names.contains(&c.name) |
| 978 | { |
| 979 | continue; |
| 980 | } |
| 981 | if !seen.insert((self.node_ids[c.from as usize].clone(), c.name.clone())) { |
| 982 | continue; |
| 983 | } |
| 984 | let column = util::col16(self.src, &self.line_starts, c.row, c.column_byte); |
| 985 | let name_ref = self.arena.put(&c.name); |
| 986 | self.tables.push_ref(&RefRow { |
| 987 | from_idx: c.from, |
| 988 | kind: FUNCTION_REF_CODE, |
| 989 | line: c.line, |
| 990 | column, |
| 991 | reference_name: name_ref, |
| 992 | candidates: NONE_STR, |
| 993 | from_id_str: NONE_STR, |
| 994 | }); |
| 995 | } |
| 996 | } |
| 997 | |
| 998 | // --- value references (crib of python.rs — same traversal, same cases) ------ |
| 999 |
no test coverage detected