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

Function ref

__tests__/resolution-order-independence.test.ts:59–64  ·  view source on GitHub ↗
(file, from, name, kind = 'calls', written = name.replace(/^\{[^}]*\}\./, ''))

Source from the content-addressed store, hash-verified

57 return resolver;
58 };
59 const ref: Project['ref'] = (file, from, name, kind = 'calls', written = name.replace(/^\{[^}]*\}\./, '')) => {
60 const lines = files[file]!.split('\n');
61 const line = lines.findIndex((text) => text.includes(written));
62 const node = cg.getNodesInFile(file).find((n) => n.qualifiedName === from || n.name === from)!;
63 return { fromNodeId: node.id, referenceName: name, referenceKind: kind, line: line + 1, column: lines[line]!.indexOf(written), filePath: file, language };
64 };
65 return {
66 root,
67 cg,

Callers

nothing calls this directly

Calls 1

getNodesInFileMethod · 0.65

Tested by

no test coverage detected