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

Method in_misparsed_generic_call

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

dartInMisparsedGenericCall (dart.ts) — whether a member access (`.member` on `receiver`, followed by `next` under `parent`) belongs to a misparsed generic call: its callee is called, and a prefixed type argument (`p.Repo`) names a type.

(
        &self,
        receiver: Node<'t>,
        next: Option<Node<'t>>,
        parent: Option<Node<'t>>,
    )

Source from the content-addressed store, hash-verified

1556 /// a misparsed generic call: its callee is called, and a prefixed type
1557 /// argument (`p.Repo`) names a type.
1558 fn in_misparsed_generic_call(
1559 &self,
1560 receiver: Node<'t>,
1561 next: Option<Node<'t>>,
1562 parent: Option<Node<'t>>,
1563 ) -> bool {
1564 let mut after = next;
1565 let mut up = parent;
1566 while after.is_none() {
1567 let Some(u) = up.filter(|u| is_prefixed(u.kind())) else { break };
1568 after = u.next_named_sibling();
1569 up = if after.is_some() { None } else { u.parent() };
1570 }
1571 if let Some(a) = after.filter(|a| a.kind() == "relational_operator") {
1572 if self.misparsed_generic_call(a).is_some() {
1573 return true;
1574 }
1575 // `p.Box<int>.named(…)`, under an `await` too: the `<` after the prefix.
1576 if let Some(rel) = a.parent() {
1577 if self.misparsed_ctor_in(rel, receiver) {
1578 return true;
1579 }
1580 }
1581 }
1582 let Some(parent) = parent.filter(|p| p.kind() == "relational_expression") else {
1583 return false;
1584 };
1585 let in_generic_call = receiver
1586 .prev_named_sibling()
1587 .map(|b| b.kind() == "relational_operator" && self.misparsed_generic_call(b).is_some())
1588 .unwrap_or(false);
1589 // So do the import prefix and a prefixed type argument of a misparsed
1590 // generic constructor call.
1591 in_generic_call || self.misparsed_ctor_in(parent, receiver)
1592 }
1593
1594 /// dartCalleeOfArgPart (dart.ts:100-116).
1595 fn callee_of_arg_part(&self, arg_part: Node<'t>) -> Option<String> {

Callers 1

extract_member_readMethod · 0.80

Calls 4

is_prefixedFunction · 0.85
misparsed_ctor_inMethod · 0.80
mapMethod · 0.80

Tested by

no test coverage detected