MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / extract_method

Method extract_method

atomic-semantic/src/parser.rs:846–863  ·  view source on GitHub ↗

Extract a method from a class

(&self, node: &Node, source: &str, file_path: &str)

Source from the content-addressed store, hash-verified

844
845 /// Extract a method from a class
846 fn extract_method(&self, node: &Node, source: &str, file_path: &str) -> Option<Entity> {
847 let name_node = node.child_by_field_name("name")?;
848 let name = self.node_text(&name_node, source)?;
849
850 let signature = self.build_method_signature(node, source);
851
852 Some(
853 Entity::new(
854 name,
855 EntityKind::Method,
856 file_path,
857 node.start_position().row as u32 + 1,
858 node.end_position().row as u32 + 1,
859 )
860 .with_column(node.start_position().column as u32)
861 .with_signature(signature),
862 )
863 }
864
865 /// Extract an interface declaration
866 fn extract_interface(

Callers 1

extract_class_membersMethod · 0.45

Calls 4

with_columnMethod · 0.80
node_textMethod · 0.45
with_signatureMethod · 0.45

Tested by

no test coverage detected