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

Method extract_method

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

816
817 /// Extract a method from a class
818 fn extract_method(&self, node: &Node, source: &str, file_path: &str) -> Option<Entity> {
819 let name_node = node.child_by_field_name("name")?;
820 let name = self.node_text(&name_node, source)?;
821
822 let signature = self.build_method_signature(node, source);
823
824 Some(
825 Entity::new(
826 name,
827 EntityKind::Method,
828 file_path,
829 node.start_position().row as u32 + 1,
830 node.end_position().row as u32 + 1,
831 )
832 .with_column(node.start_position().column as u32)
833 .with_signature(signature),
834 )
835 }
836
837 /// Extract an interface declaration
838 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