Import node + unresolved `imports` ref for a static project path.
(ctx: ExtractorContext, importPath: string, anchorNode: SyntaxNode, source: string)
| 153 | |
| 154 | /** Import node + unresolved `imports` ref for a static project path. */ |
| 155 | function emitFileImport(ctx: ExtractorContext, importPath: string, anchorNode: SyntaxNode, source: string): void { |
| 156 | const impNode = ctx.createNode('import', importPath, anchorNode, { |
| 157 | signature: getNodeText(anchorNode, source).trim().slice(0, 100), |
| 158 | }); |
| 159 | |
| 160 | if (impNode && ctx.nodeStack.length > 0) { |
| 161 | const fromNodeId = ctx.nodeStack[ctx.nodeStack.length - 1]; |
| 162 | if (fromNodeId) { |
| 163 | ctx.addUnresolvedReference({ |
| 164 | fromNodeId, |
| 165 | referenceName: importPath, |
| 166 | referenceKind: 'imports', |
| 167 | line: anchorNode.startPosition.row + 1, |
| 168 | column: anchorNode.startPosition.column, |
| 169 | }); |
| 170 | } |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | export const nixExtractor: LanguageExtractor = { |
| 175 | functionTypes: [], |
no test coverage detected