| 1533 | } |
| 1534 | |
| 1535 | fn flush_fn_ref_candidates(&mut self) { |
| 1536 | let cands = std::mem::take(&mut self.fn_ref_cands); |
| 1537 | if cands.is_empty() || util::is_generated_file(self.file_path) { |
| 1538 | return; |
| 1539 | } |
| 1540 | let mut seen: HashSet<(String, String)> = HashSet::new(); |
| 1541 | for c in cands { |
| 1542 | // `this.<m>` and `Cls::m` shapes always flush; HOF-position string |
| 1543 | // callables skip the gate (unique-or-drop at resolution); the rest |
| 1544 | // gate on defined-in-file ∪ bare single-segment `use` imports |
| 1545 | // (path-shaped and `::`-shaped import refs match neither regex). |
| 1546 | if !c.name.starts_with("this.") && !c.name.contains("::") { |
| 1547 | let skip = c.skip_gate; |
| 1548 | if !skip |
| 1549 | && !self.defined_fn_names.contains(&c.name) |
| 1550 | && !self.imported_names.contains(&c.name) |
| 1551 | { |
| 1552 | continue; |
| 1553 | } |
| 1554 | } |
| 1555 | if !seen.insert((self.node_ids[c.from as usize].clone(), c.name.clone())) { |
| 1556 | continue; |
| 1557 | } |
| 1558 | let column = util::col16(self.src, &self.line_starts, c.row, c.column_byte); |
| 1559 | let name_ref = self.arena.put(&c.name); |
| 1560 | self.tables.push_ref(&RefRow { |
| 1561 | from_idx: c.from, |
| 1562 | kind: FUNCTION_REF_CODE, |
| 1563 | line: c.line, |
| 1564 | column, |
| 1565 | reference_name: name_ref, |
| 1566 | candidates: NONE_STR, |
| 1567 | from_id_str: NONE_STR, |
| 1568 | }); |
| 1569 | } |
| 1570 | } |
| 1571 | |
| 1572 | // --- value references ------------------------------------------------------------ |
| 1573 | |