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

Method extractPascalUses

src/extraction/tree-sitter.ts:6330–6354  ·  view source on GitHub ↗

* Extract Pascal uses clause into individual import nodes

(node: SyntaxNode)

Source from the content-addressed store, hash-verified

6328 * Extract Pascal uses clause into individual import nodes
6329 */
6330 private extractPascalUses(node: SyntaxNode): void {
6331 const importText = getNodeText(node, this.source).trim();
6332 for (let i = 0; i < node.namedChildCount; i++) {
6333 const child = node.namedChild(i);
6334 if (child?.type === 'moduleName') {
6335 const unitName = getNodeText(child, this.source);
6336 this.createNode('import', unitName, child, {
6337 signature: importText,
6338 });
6339 // Create unresolved reference for resolution
6340 if (this.nodeStack.length > 0) {
6341 const parentId = this.nodeStack[this.nodeStack.length - 1];
6342 if (parentId) {
6343 this.unresolvedReferences.push({
6344 fromNodeId: parentId,
6345 referenceName: unitName,
6346 referenceKind: 'imports',
6347 line: child.startPosition.row + 1,
6348 column: child.startPosition.column,
6349 });
6350 }
6351 }
6352 }
6353 }
6354 }
6355
6356 /**
6357 * Extract a Pascal constant declaration

Callers 1

visitPascalNodeMethod · 0.95

Calls 2

createNodeMethod · 0.95
getNodeTextFunction · 0.90

Tested by

no test coverage detected