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

Function callsAt

__tests__/rust-as-mut-chains.test.ts:198–208  ·  view source on GitHub ↗
(file: string, line: number)

Source from the content-addressed store, hash-verified

196
197/** What the calls on `line` of `file` link to, as `qualifiedName@file:line`, sorted. */
198const callsAt = (file: string, line: number): string[] => {
199 const out: string[] = [];
200 for (const node of cg.getNodesInFile(file)) {
201 for (const edge of cg.getOutgoingEdges(node.id)) {
202 if (edge.kind !== 'calls' || edge.line !== line) continue;
203 const target = cg.getNode(edge.target)!;
204 out.push(`${target.qualifiedName}@${target.filePath}:${target.startLine}`);
205 }
206 }
207 return [...new Set(out)].sort();
208};
209
210describe('a Rust call on `.as_mut()` / `.as_ref()` of a field', () => {
211 it('declared `Pin<Box<T>>` is `T`\'s method', () => {

Callers 1

Calls 4

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

Tested by

no test coverage detected