MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / flush_fn_ref_candidates

Method flush_fn_ref_candidates

codegraph-kernel/src/java.rs:1301–1332  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

1299 }
1300
1301 fn flush_fn_ref_candidates(&mut self) {
1302 let cands = std::mem::take(&mut self.fn_ref_cands);
1303 if cands.is_empty() || util::is_generated_file(self.file_path) {
1304 return;
1305 }
1306 let mut seen: HashSet<(String, String)> = HashSet::new();
1307 for c in cands {
1308 if !c.name.starts_with("this.")
1309 && !c.name.contains("::")
1310 && !self.defined_fn_names.contains(&c.name)
1311 && !self.imported_names.contains(&c.name)
1312 {
1313 continue;
1314 }
1315 // Dedupe on the node ID string (ids collide; the TS side keys on
1316 // `${fromNodeId}|${name}`).
1317 if !seen.insert((self.node_ids[c.from as usize].clone(), c.name.clone())) {
1318 continue;
1319 }
1320 let column = util::col16(self.src, &self.line_starts, c.row, c.column_byte);
1321 let name_ref = self.arena.put(&c.name);
1322 self.tables.push_ref(&RefRow {
1323 from_idx: c.from,
1324 kind: FUNCTION_REF_CODE,
1325 line: c.line,
1326 column,
1327 reference_name: name_ref,
1328 candidates: NONE_STR,
1329 from_id_str: NONE_STR,
1330 });
1331 }
1332 }
1333
1334 // --- value references ------------------------------------------------------------
1335

Callers 1

extractFunction · 0.45

Calls 5

is_generated_fileFunction · 0.85
col16Function · 0.85
putMethod · 0.65
takeFunction · 0.50
push_refMethod · 0.45

Tested by

no test coverage detected