(&mut self)
| 811 | } |
| 812 | |
| 813 | fn flush_fn_ref_candidates(&mut self) { |
| 814 | let cands = std::mem::take(&mut self.fn_ref_cands); |
| 815 | if cands.is_empty() || util::is_generated_file(self.file_path) { |
| 816 | return; |
| 817 | } |
| 818 | let mut seen: HashSet<(String, String)> = HashSet::new(); |
| 819 | for c in cands { |
| 820 | // Gate: same-file function/method names ∪ imported names (lua |
| 821 | // candidates are always bare identifiers — no `this.`/`::`). |
| 822 | if !c.name.starts_with("this.") |
| 823 | && !c.name.contains("::") |
| 824 | && !self.defined_fn_names.contains(&c.name) |
| 825 | && !self.imported_names.contains(&c.name) |
| 826 | { |
| 827 | continue; |
| 828 | } |
| 829 | if !seen.insert((self.node_ids[c.from as usize].clone(), c.name.clone())) { |
| 830 | continue; |
| 831 | } |
| 832 | let column = util::col16(self.src, &self.line_starts, c.row, c.column_byte); |
| 833 | let name_ref = self.arena.put(&c.name); |
| 834 | self.tables.push_ref(&RefRow { |
| 835 | from_idx: c.from, |
| 836 | kind: FUNCTION_REF_CODE, |
| 837 | line: c.line, |
| 838 | column, |
| 839 | reference_name: name_ref, |
| 840 | candidates: NONE_STR, |
| 841 | from_id_str: NONE_STR, |
| 842 | }); |
| 843 | } |
| 844 | } |
| 845 | } |
| 846 | |
| 847 | fn opt_str(arena: &mut Arena, s: Option<&str>) -> StrRef { |
no test coverage detected