definingDeclaration (languages/c-cpp.ts): the `declaration` a class-like definition is the type of (`struct Foo { … } foo;`). Its comment documents the type, and an unnamed type takes the name of its first variable.
(node: Node)
| 2705 | /// definition is the type of (`struct Foo { … } foo;`). Its comment documents |
| 2706 | /// the type, and an unnamed type takes the name of its first variable. |
| 2707 | fn defining_declaration(node: Node) -> Option<Node> { |
| 2708 | if !is_class_like_definition(node) { |
| 2709 | return None; |
| 2710 | } |
| 2711 | let parent = node.parent()?; |
| 2712 | let is_type = parent.child_by_field_name("type").map(|t| t.id()) == Some(node.id()); |
| 2713 | (parent.kind() == "declaration" && is_type).then_some(parent) |
| 2714 | } |
| 2715 | |
| 2716 | /// isMacroMisparsedTypeDecl (languages/c-cpp.ts:261): `class MACRO Name {…}` |
| 2717 | /// misparse residue — bodyless class/struct specifier in `type` + a |
no test coverage detected