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