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

Method extract_cpp_qualified_method_name

codegraph-kernel/src/ccpp/mod.rs:785–797  ·  view source on GitHub ↗

extractCppQualifiedMethodName (languages/c-cpp.ts): the name the declarator's qualified id ends in, an explicit specialization's without its template arguments (cppDefinedName).

(&self, node: Node)

Source from the content-addressed store, hash-verified

783 /// declarator's qualified id ends in, an explicit specialization's without
784 /// its template arguments (cppDefinedName).
785 fn extract_cpp_qualified_method_name(&self, node: Node) -> Option<String> {
786 if let Some(n) = self.recover_cpp_macro_defined_name(node) {
787 return Some(n);
788 }
789 let declarator = node.child_by_field_name("declarator")?;
790 let qid = find_declarator_qualified_id(declarator)?;
791 if let Some(name) = cpp_qualified_id_name(qid) {
792 return Some(self.cpp_defined_name(name));
793 }
794 let text = self.text(qid).trim();
795 let parts: Vec<&str> = text.split("::").filter(|p| !p.is_empty()).collect();
796 parts.last().map(|s| s.to_string())
797 }
798
799 /// cppDefinedName (languages/c-cpp.ts): a definition's name node as
800 /// named, a `template_function`'s without its template arguments

Callers 1

extract_name_rawMethod · 0.80

Calls 7

cpp_qualified_id_nameFunction · 0.85
cpp_defined_nameMethod · 0.80
mapMethod · 0.80
textMethod · 0.65
collectMethod · 0.45

Tested by

no test coverage detected