| 1251 | } |
| 1252 | |
| 1253 | fn flush_fn_ref_candidates(&mut self) { |
| 1254 | let cands = std::mem::take(&mut self.fn_ref_cands); |
| 1255 | if cands.is_empty() || util::is_generated_file(self.file_path) { |
| 1256 | return; |
| 1257 | } |
| 1258 | let mut seen: HashSet<(String, String)> = HashSet::new(); |
| 1259 | for c in cands { |
| 1260 | if !c.name.starts_with("this.") |
| 1261 | && !c.name.contains("::") |
| 1262 | && !self.defined_fn_names.contains(&c.name) |
| 1263 | && !self.imported_names.contains(&c.name) |
| 1264 | { |
| 1265 | continue; |
| 1266 | } |
| 1267 | // Dedupe on the node ID string (ids collide; the TS side keys on |
| 1268 | // `${fromNodeId}|${name}`). |
| 1269 | if !seen.insert((self.node_ids[c.from as usize].clone(), c.name.clone())) { |
| 1270 | continue; |
| 1271 | } |
| 1272 | let column = util::col16(self.src, &self.line_starts, c.row, c.column_byte); |
| 1273 | let name_ref = self.arena.put(&c.name); |
| 1274 | self.tables.push_ref(&RefRow { |
| 1275 | from_idx: c.from, |
| 1276 | kind: FUNCTION_REF_CODE, |
| 1277 | line: c.line, |
| 1278 | column, |
| 1279 | reference_name: name_ref, |
| 1280 | candidates: NONE_STR, |
| 1281 | from_id_str: NONE_STR, |
| 1282 | }); |
| 1283 | } |
| 1284 | } |
| 1285 | |
| 1286 | // --- value references ------------------------------------------------------------ |
| 1287 | |