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

Method plain_inner_callee

codegraph-kernel/src/python.rs:793–805  ·  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

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