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)
| 2680 | /// definition is the type of (`struct Foo { … } foo;`). Its comment documents |
| 2681 | /// the type, and an unnamed type takes the name of its first variable. |
| 2682 | fn defining_declaration(node: Node) -> Option<Node> { |
| 2683 | if !is_class_like_definition(node) { |
| 2684 | return None; |
| 2685 | } |
| 2686 | let parent = node.parent()?; |
| 2687 | let is_type = parent.child_by_field_name("type").map(|t| t.id()) == Some(node.id()); |
| 2688 | (parent.kind() == "declaration" && is_type).then_some(parent) |
| 2689 | } |
| 2690 | |
| 2691 | /// isMacroMisparsedTypeDecl (languages/c-cpp.ts:261): `class MACRO Name {…}` |
| 2692 | /// misparse residue — bodyless class/struct specifier in `type` + a |
no test coverage detected