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

Function emit

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

Source from the content-addressed store, hash-verified

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