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