MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / definingDeclaration

Function definingDeclaration

src/extraction/languages/c-cpp.ts:202–206  ·  view source on GitHub ↗
(node: SyntaxNode)

Source from the content-addressed store, hash-verified

200 * in a member's type. Objective-C shares it (objc.ts).
201 */
202export function definingDeclaration(node: SyntaxNode): SyntaxNode | null {
203 if (!isClassLikeDefinition(node)) return null;
204 const parent = node.parent;
205 return parent?.type === 'declaration' && getChildByField(parent, 'type')?.id === node.id ? parent : null;
206}
207
208/**
209 * The name of an unnamed class, struct, union or enum that a declaration

Callers 3

objc.tsFile · 0.90
unnamedTypeVariableNameFunction · 0.85
c-cpp.tsFile · 0.85

Calls 2

getChildByFieldFunction · 0.90
isClassLikeDefinitionFunction · 0.85

Tested by

no test coverage detected