| 964 | } |
| 965 | |
| 966 | fn flush_fn_ref_candidates(&mut self) { |
| 967 | let cands = std::mem::take(&mut self.fn_ref_cands); |
| 968 | if cands.is_empty() || util::is_generated_file(self.file_path) { |
| 969 | return; |
| 970 | } |
| 971 | let mut seen: HashSet<(String, String)> = HashSet::new(); |
| 972 | for c in cands { |
| 973 | if !c.name.starts_with("this.") |
| 974 | && !c.name.contains('.') |
| 975 | && !c.name.contains("::") |
| 976 | && !self.defined_fn_names.contains(&c.name) |
| 977 | && !self.imported_names.contains(&c.name) |
| 978 | { |
| 979 | continue; |
| 980 | } |
| 981 | if !seen.insert((self.node_ids[c.from as usize].clone(), c.name.clone())) { |
| 982 | continue; |
| 983 | } |
| 984 | let column = util::col16(self.src, &self.line_starts, c.row, c.column_byte); |
| 985 | let name_ref = self.arena.put(&c.name); |
| 986 | self.tables.push_ref(&RefRow { |
| 987 | from_idx: c.from, |
| 988 | kind: FUNCTION_REF_CODE, |
| 989 | line: c.line, |
| 990 | column, |
| 991 | reference_name: name_ref, |
| 992 | candidates: NONE_STR, |
| 993 | from_id_str: NONE_STR, |
| 994 | }); |
| 995 | } |
| 996 | } |
| 997 | |
| 998 | // --- value refs ------------------------------------------------------------------- |
| 999 | |