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

Function emit

src/extraction/languages/lua.ts:112–130  ·  view source on GitHub ↗
(callNode: SyntaxNode)

Source from the content-addressed store, hash-verified

110 const source = ctx.source;
111
112 const emit = (callNode: SyntaxNode): void => {
113 const mod = requireModule(callNode, source);
114 if (!mod) return;
115 const imp = ctx.createNode('import', mod, callNode, {
116 signature: getNodeText(callNode, source).trim().slice(0, 100),
117 });
118 if (imp && ctx.nodeStack.length > 0) {
119 const parentId = ctx.nodeStack[ctx.nodeStack.length - 1];
120 if (parentId) {
121 ctx.addUnresolvedReference({
122 fromNodeId: parentId,
123 referenceName: mod,
124 referenceKind: 'imports',
125 line: callNode.startPosition.row + 1,
126 column: callNode.startPosition.column,
127 });
128 }
129 }
130 };
131
132 // Bare / global `require("x")` — claim it so it isn't double-counted as a call.
133 if (node.type === 'function_call') {

Callers 1

lua.tsFile · 0.70

Calls 4

getNodeTextFunction · 0.90
requireModuleFunction · 0.85
createNodeMethod · 0.65

Tested by

no test coverage detected