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

Method is_foreign_field

codegraph-kernel/src/java.rs:1338–1354  ·  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

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