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

Method in_misparsed_generic_call

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

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