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

Method plain_inner_callee

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

777 /// The callee of a call receiver when it is a plain identifier or attribute
778 /// chain (`make`, `d.setdefault`), whitespace stripped (#1683).
779 fn plain_inner_callee(&self, call: Node<'t>) -> Option<String> {
780 let inner = call.child_by_field_name("function")?;
781 let text: String = self.text(inner).chars().filter(|c| !c.is_whitespace()).collect();
782 if text.is_empty() {
783 return None;
784 }
785 let ok = text.split('.').all(|seg| {
786 let mut chars = seg.chars();
787 matches!(chars.next(), Some(c) if c.is_ascii_alphabetic() || c == '_')
788 && chars.all(|c| c.is_ascii_alphanumeric() || c == '_')
789 });
790 if ok { Some(text) } else { None }
791 }
792
793 /// extractDecoratorsFor — python decorators are PRECEDING SIBLINGS inside
794 /// 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