(node: Node<'_>, language: Language)
| 14 | } |
| 15 | |
| 16 | pub(super) fn class_like(node: Node<'_>, language: Language) -> bool { |
| 17 | match language { |
| 18 | Language::TypeScript | Language::Tsx => matches!( |
| 19 | node.kind(), |
| 20 | "class_declaration" | "abstract_class_declaration" | "class" |
| 21 | ), |
| 22 | Language::Python => node.kind() == "class_definition", |
| 23 | Language::Java => matches!( |
| 24 | node.kind(), |
| 25 | "class_declaration" | "record_declaration" | "enum_declaration" |
| 26 | ), |
| 27 | Language::Cpp => matches!(node.kind(), "class_specifier" | "struct_specifier"), |
| 28 | Language::Swift => { |
| 29 | node.kind() == "class_declaration" |
| 30 | && node |
| 31 | .child_by_field_name("declaration_kind") |
| 32 | .is_some_and(|kind| kind.kind() == "class") |
| 33 | } |
| 34 | Language::Rust | Language::Go | Language::C => false, |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | pub(super) fn type_boundary(node: Node<'_>, language: Language) -> bool { |
| 39 | class_like(node, language) |
no test coverage detected