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

Method is_field_or_top_level_entry

codegraph-kernel/src/dart.rs:1803–1817  ·  view source on GitHub ↗

isDartFieldOrTopLevelEntry (dart.ts) — an `initialized_identifier` declaring a field or a top-level variable, not the second variable of a local declaration (`for (var i = 0, j = n(); …)`).

(&self, node: Node<'t>)

Source from the content-addressed store, hash-verified

1801 /// declaring a field or a top-level variable, not the second variable of
1802 /// a local declaration (`for (var i = 0, j = n(); …)`).
1803 fn is_field_or_top_level_entry(&self, node: Node<'t>) -> bool {
1804 let Some(list) = node.parent() else { return false };
1805 if list.kind() != "initialized_identifier_list" {
1806 return false;
1807 }
1808 let Some(owner) = list.parent() else { return false };
1809 if owner.kind() == "program" {
1810 return true;
1811 }
1812 owner.kind() == "declaration"
1813 && owner
1814 .parent()
1815 .map(|p| matches!(p.kind(), "class_body" | "extension_body" | "enum_body"))
1816 .unwrap_or(false)
1817 }
1818
1819 /// dartMemberRead (dart.ts) — `x.area` / `x?.area` not followed by a call's
1820 /// argument part, receiver a plain name: a `references` ref `x.area` on

Callers 1

visitMethod · 0.80

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected