| 1568 | } |
| 1569 | |
| 1570 | fn flush_fn_ref_candidates(&mut self) { |
| 1571 | let cands = std::mem::take(&mut self.fn_ref_cands); |
| 1572 | if cands.is_empty() || util::is_generated_file(self.file_path) { |
| 1573 | return; |
| 1574 | } |
| 1575 | let mut seen: HashSet<(String, String)> = HashSet::new(); |
| 1576 | for c in cands { |
| 1577 | // C# candidates are always bare names (its this-forms normalize to |
| 1578 | // the bare member), so the `this.`/`::` bypasses are inert — kept |
| 1579 | // for shared-shape parity. Gate: definedHere ∪ importedNames. |
| 1580 | if !c.name.starts_with("this.") |
| 1581 | && !c.name.contains("::") |
| 1582 | && !self.defined_fn_names.contains(&c.name) |
| 1583 | && !self.imported_names.contains(&c.name) |
| 1584 | { |
| 1585 | continue; |
| 1586 | } |
| 1587 | if !seen.insert((self.node_ids[c.from as usize].clone(), c.name.clone())) { |
| 1588 | continue; |
| 1589 | } |
| 1590 | let column = util::col16(self.src, &self.line_starts, c.row, c.column_byte); |
| 1591 | let name_ref = self.arena.put(&c.name); |
| 1592 | self.tables.push_ref(&RefRow { |
| 1593 | from_idx: c.from, |
| 1594 | kind: FUNCTION_REF_CODE, |
| 1595 | line: c.line, |
| 1596 | column, |
| 1597 | reference_name: name_ref, |
| 1598 | candidates: NONE_STR, |
| 1599 | from_id_str: NONE_STR, |
| 1600 | }); |
| 1601 | } |
| 1602 | } |
| 1603 | |
| 1604 | // --- value references -------------------------------------------------------- |
| 1605 | |