| 1525 | } |
| 1526 | |
| 1527 | fn flush_fn_ref_candidates(&mut self) { |
| 1528 | let cands = std::mem::take(&mut self.fn_ref_cands); |
| 1529 | if cands.is_empty() || util::is_generated_file(self.file_path) { |
| 1530 | return; |
| 1531 | } |
| 1532 | let mut seen: HashSet<(String, String)> = HashSet::new(); |
| 1533 | for c in cands { |
| 1534 | if !c.name.starts_with("this.") |
| 1535 | && !c.name.contains("::") |
| 1536 | && !self.defined_fn_names.contains(&c.name) |
| 1537 | && !self.imported_names.contains(&c.name) |
| 1538 | { |
| 1539 | continue; |
| 1540 | } |
| 1541 | if !seen.insert((self.node_ids[c.from as usize].clone(), c.name.clone())) { |
| 1542 | continue; |
| 1543 | } |
| 1544 | let column = util::col16(self.src, &self.line_starts, c.row, c.column_byte); |
| 1545 | let name_ref = self.arena.put(&c.name); |
| 1546 | self.tables.push_ref(&RefRow { |
| 1547 | from_idx: c.from, |
| 1548 | kind: FUNCTION_REF_CODE, |
| 1549 | line: c.line, |
| 1550 | column, |
| 1551 | reference_name: name_ref, |
| 1552 | candidates: NONE_STR, |
| 1553 | from_id_str: NONE_STR, |
| 1554 | }); |
| 1555 | } |
| 1556 | } |
| 1557 | |
| 1558 | // --- value refs ------------------------------------------------------------- |
| 1559 | |