(callNode: SyntaxNode)
| 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') { |
no test coverage detected