| 1593 | } |
| 1594 | |
| 1595 | fn flush_fn_ref_candidates(&mut self) { |
| 1596 | let cands = std::mem::take(&mut self.fn_ref_cands); |
| 1597 | if cands.is_empty() || util::is_generated_file(self.file_path) { |
| 1598 | return; |
| 1599 | } |
| 1600 | let mut seen: HashSet<(String, String)> = HashSet::new(); |
| 1601 | for c in cands { |
| 1602 | // C# candidates are bare names (its this-forms normalize to the |
| 1603 | // bare member), so the `this.`/`::` bypasses are inert — kept for |
| 1604 | // shared-shape parity — or a method group through a receiver |
| 1605 | // (`worker.Run`), the only dotted one, which skips the gate as its |
| 1606 | // TS twin's `skipGate` does. Gate: definedHere ∪ importedNames. |
| 1607 | if !c.name.starts_with("this.") |
| 1608 | && !c.name.contains("::") |
| 1609 | && !c.name.contains('.') |
| 1610 | && !self.defined_fn_names.contains(&c.name) |
| 1611 | && !self.imported_names.contains(&c.name) |
| 1612 | { |
| 1613 | continue; |
| 1614 | } |
| 1615 | if !seen.insert((self.node_ids[c.from as usize].clone(), c.name.clone())) { |
| 1616 | continue; |
| 1617 | } |
| 1618 | let column = util::col16(self.src, &self.line_starts, c.row, c.column_byte); |
| 1619 | let name_ref = self.arena.put(&c.name); |
| 1620 | self.tables.push_ref(&RefRow { |
| 1621 | from_idx: c.from, |
| 1622 | kind: FUNCTION_REF_CODE, |
| 1623 | line: c.line, |
| 1624 | column, |
| 1625 | reference_name: name_ref, |
| 1626 | candidates: NONE_STR, |
| 1627 | from_id_str: NONE_STR, |
| 1628 | }); |
| 1629 | } |
| 1630 | } |
| 1631 | |
| 1632 | // --- value references -------------------------------------------------------- |
| 1633 | |