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

Function definingDeclaration

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

Source from the content-addressed store, hash-verified

203 * in a member's type. Objective-C shares it (objc.ts).
204 */
205export function definingDeclaration(node: SyntaxNode): SyntaxNode | null {
206 if (!isClassLikeDefinition(node)) return null;
207 const parent = node.parent;
208 return parent?.type === 'declaration' && getChildByField(parent, 'type')?.id === node.id ? parent : null;
209}
210
211/**
212 * 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