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

Function targetsOf

__tests__/kotlin-class-header-code.test.ts:239–247  ·  view source on GitHub ↗

Qualified names of what the class or object named `name` in `file` links to.

(file: string, name: string)

Source from the content-addressed store, hash-verified

237
238 /** Qualified names of what the class or object named `name` in `file` links to. */
239 function targetsOf(file: string, name: string): string[] {
240 const node = cg.getNodesInFile(file).find((n) => n.name === name);
241 expect(node, `no node named ${name} in ${file}`).toBeDefined();
242 return cg
243 .getOutgoingEdges(node!.id)
244 .filter((e) => e.kind !== 'contains')
245 .map((e) => `${e.kind} ${cg.getNode(e.target)!.qualifiedName}`)
246 .sort();
247 }
248
249 // A call that names a class resolves to it as an instantiation.
250 it('a `by` delegate and a superclass constructor argument', () => {

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesInFileMethod · 0.65
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected