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

Method is_foreign_field

codegraph-kernel/src/java.rs:1340–1356  ·  view source on GitHub ↗

isForeignJavaField: `InferenceString.PARSER` reads that class's constant, not the `PARSER` of the file reading it.

(&self, n: Node<'t>, target_row: u32)

Source from the content-addressed store, hash-verified

1338 /// isForeignJavaField: `InferenceString.PARSER` reads that class's constant,
1339 /// not the `PARSER` of the file reading it.
1340 fn is_foreign_field(&self, n: Node<'t>, target_row: u32) -> bool {
1341 let Some(access) = n.parent() else { return false };
1342 if access.kind() != "field_access" {
1343 return false;
1344 }
1345 let Some(object) = access.child_by_field_name("object") else { return false };
1346 if access.child_by_field_name("field").map(|f| f.start_byte()) != Some(n.start_byte()) {
1347 return false;
1348 }
1349 let written = self.text(object);
1350 let qualifier = written.rsplit('.').next().unwrap_or("").trim();
1351 if qualifier == "this" {
1352 return false;
1353 }
1354 let qualified = &self.nodes_meta[target_row as usize].qualified_name;
1355 qualified.rsplit("::").nth(1) != Some(qualifier)
1356 }
1357
1358 fn flush_value_refs(&mut self, root: Node<'t>) {
1359 let scopes = std::mem::take(&mut self.value_scopes);

Callers 1

flush_value_refsMethod · 0.80

Calls 3

mapMethod · 0.80
nextMethod · 0.80
textMethod · 0.65

Tested by

no test coverage detected