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

Method createFileNode

src/extraction/liquid-extractor.ts:75–95  ·  view source on GitHub ↗

* Create a file node for the Liquid template

()

Source from the content-addressed store, hash-verified

73 * Create a file node for the Liquid template
74 */
75 private createFileNode(): Node {
76 const lines = this.source.split('\n');
77 const id = generateNodeId(this.filePath, 'file', this.filePath, 1);
78
79 const fileNode: Node = {
80 id,
81 kind: 'file',
82 name: this.filePath.split('/').pop() || this.filePath,
83 qualifiedName: this.filePath,
84 filePath: this.filePath,
85 language: 'liquid',
86 startLine: 1,
87 endLine: lines.length,
88 startColumn: 0,
89 endColumn: lines[lines.length - 1]?.length || 0,
90 updatedAt: Date.now(),
91 };
92
93 this.nodes.push(fileNode);
94 return fileNode;
95 }
96
97 /**
98 * Shopify OS 2.0 JSON template / section group. Both have a `sections` object

Callers 1

extractMethod · 0.95

Calls 1

generateNodeIdFunction · 0.90

Tested by

no test coverage detected