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

Method extract_method

atomic-semantic/src/parser.rs:801–818  ·  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

799
800 /// Extract a method from a class
801 fn extract_method(&self, node: &Node, source: &str, file_path: &str) -> Option<Entity> {
802 let name_node = node.child_by_field_name("name")?;
803 let name = self.node_text(&name_node, source)?;
804
805 let signature = self.build_method_signature(node, source);
806
807 Some(
808 Entity::new(
809 name,
810 EntityKind::Method,
811 file_path,
812 node.start_position().row as u32 + 1,
813 node.end_position().row as u32 + 1,
814 )
815 .with_column(node.start_position().column as u32)
816 .with_signature(signature),
817 )
818 }
819
820 /// Extract an interface declaration
821 fn extract_interface(

Callers 1

extract_class_membersMethod · 0.45

Calls 4

with_signatureMethod · 0.80
with_columnMethod · 0.80
node_textMethod · 0.45

Tested by

no test coverage detected