| 999 | } |
| 1000 | |
| 1001 | fn flush_fn_ref_candidates(&mut self) { |
| 1002 | let cands = std::mem::take(&mut self.fn_ref_cands); |
| 1003 | if cands.is_empty() || util::is_generated_file(self.file_path) { |
| 1004 | return; |
| 1005 | } |
| 1006 | let mut seen: HashSet<(String, String)> = HashSet::new(); |
| 1007 | for c in cands { |
| 1008 | if !c.name.starts_with("this.") |
| 1009 | && !c.name.contains('.') |
| 1010 | && !c.name.contains("::") |
| 1011 | && !self.defined_fn_names.contains(&c.name) |
| 1012 | && !self.imported_names.contains(&c.name) |
| 1013 | { |
| 1014 | continue; |
| 1015 | } |
| 1016 | if !seen.insert((self.node_ids[c.from as usize].clone(), c.name.clone())) { |
| 1017 | continue; |
| 1018 | } |
| 1019 | let column = util::col16(self.src, &self.line_starts, c.row, c.column_byte); |
| 1020 | let name_ref = self.arena.put(&c.name); |
| 1021 | self.tables.push_ref(&RefRow { |
| 1022 | from_idx: c.from, |
| 1023 | kind: FUNCTION_REF_CODE, |
| 1024 | line: c.line, |
| 1025 | column, |
| 1026 | reference_name: name_ref, |
| 1027 | candidates: NONE_STR, |
| 1028 | from_id_str: NONE_STR, |
| 1029 | }); |
| 1030 | } |
| 1031 | } |
| 1032 | |
| 1033 | // --- value refs ------------------------------------------------------------------- |
| 1034 | |