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