| 1498 | } |
| 1499 | |
| 1500 | fn flush_fn_ref_candidates(&mut self) { |
| 1501 | let cands = std::mem::take(&mut self.fn_ref_cands); |
| 1502 | if cands.is_empty() || util::is_generated_file(self.file_path) { |
| 1503 | return; |
| 1504 | } |
| 1505 | let mut seen: HashSet<(String, String)> = HashSet::new(); |
| 1506 | for c in cands { |
| 1507 | if !c.name.starts_with("this.") |
| 1508 | && !c.name.contains("::") |
| 1509 | && !self.defined_fn_names.contains(&c.name) |
| 1510 | && !self.imported_names.contains(&c.name) |
| 1511 | { |
| 1512 | continue; |
| 1513 | } |
| 1514 | if !seen.insert((self.node_ids[c.from as usize].clone(), c.name.clone())) { |
| 1515 | continue; |
| 1516 | } |
| 1517 | let column = util::col16(self.src, &self.line_starts, c.row, c.column_byte); |
| 1518 | let name_ref = self.arena.put(&c.name); |
| 1519 | self.tables.push_ref(&RefRow { |
| 1520 | from_idx: c.from, |
| 1521 | kind: FUNCTION_REF_CODE, |
| 1522 | line: c.line, |
| 1523 | column, |
| 1524 | reference_name: name_ref, |
| 1525 | candidates: NONE_STR, |
| 1526 | from_id_str: NONE_STR, |
| 1527 | }); |
| 1528 | } |
| 1529 | } |
| 1530 | |
| 1531 | // --- value refs ------------------------------------------------------------- |
| 1532 | |