Extract an `init` declaration. Initializers have no explicit name — we use `"init"` as the entity name.
(&self, node: &Node, source: &str, file_path: &str)
| 239 | /// |
| 240 | /// Initializers have no explicit name — we use `"init"` as the entity name. |
| 241 | fn extract_init(&self, node: &Node, source: &str, file_path: &str) -> Option<Entity> { |
| 242 | let line = node.start_position().row as u32 + 1; |
| 243 | let end_line = node.end_position().row as u32 + 1; |
| 244 | |
| 245 | let exported = self.is_exported(node, source); |
| 246 | let signature = self.build_init_signature(node, source); |
| 247 | |
| 248 | let mut entity = Entity::new("init", EntityKind::Method, file_path, line, end_line); |
| 249 | if let Some(sig) = signature { |
| 250 | entity = entity.with_signature(sig); |
| 251 | } |
| 252 | entity.exported = exported; |
| 253 | |
| 254 | Some(entity) |
| 255 | } |
| 256 | |
| 257 | /// Extract a type declaration (class, struct, enum, protocol). |
| 258 | /// |
no test coverage detected