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

Function callsAt

__tests__/rust-receiver-chains.test.ts:133–143  ·  view source on GitHub ↗
(name: keyof typeof graphs, file: string, line: number)

Source from the content-addressed store, hash-verified

131
132/** The calls on `line` of `file`, as `qualifiedName resolvedBy refName`, sorted. */
133const callsAt = (name: keyof typeof graphs, file: string, line: number): string[] => {
134 const cg = graphs[name];
135 const out: string[] = [];
136 for (const node of cg.getNodesInFile(file)) {
137 for (const edge of cg.getOutgoingEdges(node.id)) {
138 if (edge.kind !== 'calls' || edge.line !== line || edge.provenance === 'heuristic') continue;
139 out.push(`${cg.getNode(edge.target)!.qualifiedName} ${String(edge.metadata?.resolvedBy)} ${String(edge.metadata?.refName)}`);
140 }
141 }
142 return [...new Set(out)].sort();
143};
144
145describe('the issue\'s workspace (#2836)', () => {
146 it('a call on two fields keeps its receiver: on one line, after `let _ =`, split by rustfmt', () => {

Callers 1

Calls 4

pushMethod · 0.80
getNodeMethod · 0.80
getNodesInFileMethod · 0.65
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected