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