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

Function targetsFrom

__tests__/vbnet-project-ties.test.ts:109–119  ·  view source on GitHub ↗

`Owner::member @ file` of every call / instantiation edge out of a file.

(file: string, kind: 'calls' | 'instantiates')

Source from the content-addressed store, hash-verified

107
108/** `Owner::member @ file` of every call / instantiation edge out of a file. */
109function targetsFrom(file: string, kind: 'calls' | 'instantiates'): string[] {
110 const ids = cg.getNodesInFile(file).map((n) => n.id);
111 return cg
112 .getOutgoingEdgesFrom(ids)
113 .filter((e) => e.kind === kind)
114 .map((e) => {
115 const target = cg.getNode(e.target)!;
116 return `${target.qualifiedName} @ ${target.filePath}`;
117 })
118 .sort();
119}
120
121describe('VB.NET duplicate types across projects', () => {
122 it('resolve a call to the caller’s own project’s copy', () => {

Callers 1

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesInFileMethod · 0.65
getOutgoingEdgesFromMethod · 0.45

Tested by

no test coverage detected