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

Method in_misparsed_generic_call

codegraph-kernel/src/dart.rs:1569–1603  ·  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

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