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

Method extract_class

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

Extract a class declaration

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

Source from the content-addressed store, hash-verified

793
794 /// Extract a class declaration
795 fn extract_class(
796 &self,
797 node: &Node,
798 source: &str,
799 file_path: &str,
800 exported: bool,
801 ) -> 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_class_signature(node, source);
806
807 Some(
808 Entity::new(
809 name,
810 EntityKind::Class,
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 .with_exported(exported),
818 )
819 }
820
821 /// Extract class methods
822 fn extract_class_members(

Callers 1

walk_treeMethod · 0.45

Calls 5

with_exportedMethod · 0.80
with_columnMethod · 0.80
node_textMethod · 0.45
build_class_signatureMethod · 0.45
with_signatureMethod · 0.45

Tested by

no test coverage detected