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

Method extract_interface

atomic-semantic/src/parsers/java.rs:178–198  ·  view source on GitHub ↗

Extract an interface declaration.

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

Source from the content-addressed store, hash-verified

176
177 /// Extract an interface declaration.
178 fn extract_interface(&self, node: &Node, source: &str, file_path: &str) -> Option<Entity> {
179 let name_node = node.child_by_field_name("name")?;
180 let name = self.node_text(&name_node, source);
181
182 let line = node.start_position().row as u32 + 1;
183 let end_line = node.end_position().row as u32 + 1;
184
185 let exported = self.has_modifier(node, source, "public");
186
187 let signature = self.build_interface_signature(node, source);
188
189 let mut entity = Entity::new(name, EntityKind::Interface, file_path, line, end_line);
190 if let Some(sig) = signature {
191 entity = entity.with_signature(sig);
192 }
193 if exported {
194 entity.exported = true;
195 }
196
197 Some(entity)
198 }
199
200 /// Extract an enum declaration.
201 fn extract_enum(&self, node: &Node, source: &str, file_path: &str) -> Option<Entity> {

Callers 1

walk_treeMethod · 0.45

Calls 4

has_modifierMethod · 0.80
with_signatureMethod · 0.80
node_textMethod · 0.45

Tested by

no test coverage detected