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

Function handleBehaviour

src/extraction/languages/erlang.ts:198–214  ·  view source on GitHub ↗
(node: SyntaxNode, ctx: ExtractorContext)

Source from the content-addressed store, hash-verified

196}
197
198function handleBehaviour(node: SyntaxNode, ctx: ExtractorContext): boolean {
199 const nameNode = getChildByField(node, 'name');
200 const parentId = ctx.nodeStack[ctx.nodeStack.length - 1];
201 if (nameNode && parentId) {
202 // `-behaviour(x)` implements x's callback contract. Resolves when the
203 // behaviour module is in the repo; OTP behaviours (gen_server, …) simply
204 // stay unresolved.
205 ctx.addUnresolvedReference({
206 fromNodeId: parentId,
207 referenceName: atomText(nameNode, ctx.source),
208 referenceKind: 'implements',
209 line: node.startPosition.row + 1,
210 column: node.startPosition.column,
211 });
212 }
213 return true;
214}
215
216/**
217 * OTP application resource file (`<app>.app.src` / `<app>.app`): a single

Callers 1

erlang.tsFile · 0.85

Calls 3

getChildByFieldFunction · 0.90
atomTextFunction · 0.85

Tested by

no test coverage detected