(&mut self)
| 1373 | } |
| 1374 | |
| 1375 | fn flush_fn_ref_candidates(&mut self) { |
| 1376 | let cands = std::mem::take(&mut self.fn_ref_cands); |
| 1377 | if cands.is_empty() || util::is_generated_file(self.file_path) { |
| 1378 | return; |
| 1379 | } |
| 1380 | let mut seen: HashSet<(String, String)> = HashSet::new(); |
| 1381 | for c in cands { |
| 1382 | // `this.<m>` and `Cls::m` shapes always flush; HOF-position string |
| 1383 | // callables skip the gate (unique-or-drop at resolution); the rest |
| 1384 | // gate on defined-in-file ∪ bare single-segment `use` imports |
| 1385 | // (path-shaped and `::`-shaped import refs match neither regex). |
| 1386 | if !c.name.starts_with("this.") && !c.name.contains("::") { |
| 1387 | let skip = c.skip_gate; |
| 1388 | if !skip |
| 1389 | && !self.defined_fn_names.contains(&c.name) |
| 1390 | && !self.imported_names.contains(&c.name) |
| 1391 | { |
| 1392 | continue; |
| 1393 | } |
| 1394 | } |
| 1395 | if !seen.insert((self.node_ids[c.from as usize].clone(), c.name.clone())) { |
| 1396 | continue; |
| 1397 | } |
| 1398 | let column = util::col16(self.src, &self.line_starts, c.row, c.column_byte); |
| 1399 | let name_ref = self.arena.put(&c.name); |
| 1400 | self.tables.push_ref(&RefRow { |
| 1401 | from_idx: c.from, |
| 1402 | kind: FUNCTION_REF_CODE, |
| 1403 | line: c.line, |
| 1404 | column, |
| 1405 | reference_name: name_ref, |
| 1406 | candidates: NONE_STR, |
| 1407 | from_id_str: NONE_STR, |
| 1408 | }); |
| 1409 | } |
| 1410 | } |
| 1411 | |
| 1412 | // --- value references ------------------------------------------------------------ |
| 1413 |
no test coverage detected