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

Function callRefsOf

__tests__/extraction.test.ts:4736–4739  ·  view source on GitHub ↗
(body: string)

Source from the content-addressed store, hash-verified

4734 // and emits `<receiver>.operator+` like any other member call.
4735 const HEADER = 'struct V {\n V operator+(const V& o) const;\n V operator[](int i) const;\n V operator()(int i) const;\n bool operator==(const V& o) const;\n int get() const;\n};\n';
4736 const callRefsOf = (body: string) =>
4737 extractFromSource('op.cpp', HEADER + body)
4738 .unresolvedReferences.filter((r) => r.referenceKind === 'calls')
4739 .map((r) => r.referenceName);
4740
4741 it('recovers receiver.operator+ from the explicit call form', () => {
4742 expect(callRefsOf('V f(const V& a, const V& b) { return a.operator+(b); }\n')).toContain('a.operator+');

Callers 1

extraction.test.tsFile · 0.85

Calls 2

extractFromSourceFunction · 0.90
mapMethod · 0.80

Tested by

no test coverage detected