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