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

Function index

__tests__/ruby-singleton-methods.test.ts:137–148  ·  view source on GitHub ↗
(backend: string)

Source from the content-addressed store, hash-verified

135});
136
137async function index(backend: string): Promise<CodeGraph> {
138 savedKernel = process.env.CODEGRAPH_KERNEL;
139 if (backend === 'wasm') process.env.CODEGRAPH_KERNEL = '0';
140 else delete process.env.CODEGRAPH_KERNEL;
141 root = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-ruby-singleton-'));
142 for (const [rel, content] of Object.entries(FILES)) {
143 fs.mkdirSync(path.dirname(path.join(root, rel)), { recursive: true });
144 fs.writeFileSync(path.join(root, rel), content);
145 }
146 cg = await CodeGraph.init(root, { index: true });
147 return cg;
148}
149
150/** `<qualified name>:<line>` of the method each `calls` edge written on `line` of `file` reaches. */
151function callsAt(graph: CodeGraph, file: string, line: number): string[] {

Callers 1

Calls 2

joinMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected