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

Method plain_inner_callee

codegraph-kernel/src/python.rs:791–803  ·  view source on GitHub ↗

The callee of a call receiver when it is a plain identifier or attribute chain (`make`, `d.setdefault`), whitespace stripped (#1683).

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

Source from the content-addressed store, hash-verified

789 /// The callee of a call receiver when it is a plain identifier or attribute
790 /// chain (`make`, `d.setdefault`), whitespace stripped (#1683).
791 fn plain_inner_callee(&self, call: Node<'t>) -> Option<String> {
792 let inner = call.child_by_field_name("function")?;
793 let text: String = self.text(inner).chars().filter(|c| !c.is_whitespace()).collect();
794 if text.is_empty() {
795 return None;
796 }
797 let ok = text.split('.').all(|seg| {
798 let mut chars = seg.chars();
799 matches!(chars.next(), Some(c) if c.is_ascii_alphabetic() || c == '_')
800 && chars.all(|c| c.is_ascii_alphanumeric() || c == '_')
801 });
802 if ok { Some(text) } else { None }
803 }
804
805 /// extractDecoratorsFor — python decorators are PRECEDING SIBLINGS inside
806 /// decorated_definition. Only bare-identifier decorators yield a target

Callers 1

extract_callMethod · 0.45

Calls 3

textMethod · 0.65
allMethod · 0.65
collectMethod · 0.45

Tested by

no test coverage detected