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

Method delegateQueryTag

src/extraction/cfml-extractor.ts:745–764  ·  view source on GitHub ↗

* Delegate a ` ... ` tag's SQL body to the `cfquery` grammar. * `#hash#` expressions inside the SQL (e.g. `#getCurrentUser().getId()#` in a * WHERE clause) are real CFML calls/references — tree-sitter-cfml's `cfquery` * grammar parses them structurally (same `call_expressio

(queryTag: SyntaxNode, parentId: string | undefined)

Source from the content-addressed store, hash-verified

743 * or contains-edges to merge.
744 */
745 private delegateQueryTag(queryTag: SyntaxNode, parentId: string | undefined): void {
746 const content = queryTag.namedChildren.find((c: SyntaxNode) => c.type === 'cf_query_content');
747 if (!content) return;
748
749 const sql = this.source.substring(content.startIndex, content.endIndex);
750 const startLine = content.startPosition.row;
751
752 const extractor = new TreeSitterExtractor(this.filePath, sql, 'cfquery');
753 const result = extractor.extract();
754
755 const innerFileNodeId = result.nodes.find((n) => n.kind === 'file')?.id;
756 for (const ref of result.unresolvedReferences) {
757 ref.line += startLine;
758 ref.filePath = this.filePath;
759 ref.language = this.language;
760 if ((!ref.fromNodeId || ref.fromNodeId === innerFileNodeId) && parentId) ref.fromNodeId = parentId;
761 this.unresolvedReferences.push(ref);
762 }
763 this.addBlockErrors(result.errors, queryTag, 'cfquery', startLine);
764 }
765
766 /** Read a `cf_attribute`'s value by name from a tag node's direct `cf_attribute`/`cf_tag_attributes` children. */
767 private tagAttr(tag: SyntaxNode, attrName: string): string | undefined {

Callers 1

visitTagMethod · 0.95

Calls 3

extractMethod · 0.95
addBlockErrorsMethod · 0.95
pushMethod · 0.80

Tested by

no test coverage detected