| 1465 | } |
| 1466 | |
| 1467 | fn flush_fn_ref_candidates(&mut self) { |
| 1468 | let cands = std::mem::take(&mut self.fn_ref_cands); |
| 1469 | if cands.is_empty() || util::is_generated_file(self.file_path) { |
| 1470 | return; |
| 1471 | } |
| 1472 | let mut seen: HashSet<(String, String)> = HashSet::new(); |
| 1473 | for c in cands { |
| 1474 | if !c.name.starts_with("this.") |
| 1475 | && !c.name.contains("::") |
| 1476 | && !self.defined_fn_names.contains(&c.name) |
| 1477 | && !self.imported_names.contains(&c.name) |
| 1478 | { |
| 1479 | continue; |
| 1480 | } |
| 1481 | if !seen.insert((self.node_ids[c.from as usize].clone(), c.name.clone())) { |
| 1482 | continue; |
| 1483 | } |
| 1484 | let column = util::col16(self.src, &self.line_starts, c.row, c.column_byte); |
| 1485 | let name_ref = self.arena.put(&c.name); |
| 1486 | self.tables.push_ref(&RefRow { |
| 1487 | from_idx: c.from, |
| 1488 | kind: FUNCTION_REF_CODE, |
| 1489 | line: c.line, |
| 1490 | column, |
| 1491 | reference_name: name_ref, |
| 1492 | candidates: NONE_STR, |
| 1493 | from_id_str: NONE_STR, |
| 1494 | }); |
| 1495 | } |
| 1496 | } |
| 1497 | |
| 1498 | // --- value references ------------------------------------------------------------- |
| 1499 | |