(state: &mut ExtractionState, node: TsNode<'_>)
| 216 | } |
| 217 | |
| 218 | fn visit_instance(state: &mut ExtractionState, node: TsNode<'_>) { |
| 219 | // instance ClassName Type where ... |
| 220 | let sig_text = Self::first_line(state, node).unwrap_or_default(); |
| 221 | let name = sig_text |
| 222 | .trim_start_matches("instance") |
| 223 | .split_whitespace() |
| 224 | .take(2) |
| 225 | .collect::<Vec<_>>() |
| 226 | .join(" "); |
| 227 | if name.is_empty() { |
| 228 | return; |
| 229 | } |
| 230 | |
| 231 | let start_line = node.start_position().row as u32; |
| 232 | let qualified_name = format!("{}::instance {}", state.file_path, name); |
| 233 | let id = generate_node_id(&state.file_path, &NodeKind::Class, &name, start_line); |
| 234 | |
| 235 | Self::emit( |
| 236 | state, |
| 237 | id, |
| 238 | NodeKind::Class, |
| 239 | name, |
| 240 | qualified_name, |
| 241 | node, |
| 242 | Some(sig_text), |
| 243 | None, |
| 244 | ); |
| 245 | } |
| 246 | |
| 247 | fn visit_import(state: &mut ExtractionState, node: TsNode<'_>) { |
| 248 | let text = state.node_text(node); |
nothing calls this directly
no test coverage detected