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

Method createFileNode

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

* Create a file node for the Liquid template

()

Source from the content-addressed store, hash-verified

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

Callers 1

extractMethod · 0.95

Calls 2

generateNodeIdFunction · 0.90
pushMethod · 0.80

Tested by

no test coverage detected