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

Method resolveRustPathValue

src/resolution/index.ts:1805–1813  ·  view source on GitHub ↗

* A Rust function passed through its path (`map(Graph::counts)`, #3254) * names what the same path written as a call names, gates included: the * call's module, `use` and `Self` rules decide, and a std type that only * shares a project type's name reaches nothing. Only a function, an * i

(ref: UnresolvedRef)

Source from the content-addressed store, hash-verified

1803 * inherent method (isRustOtherTypesMethod).
1804 */
1805 private resolveRustPathValue(ref: UnresolvedRef): ResolvedRef | null {
1806 const asCall = this.resolveOneIn({ ...ref, referenceKind: 'calls' });
1807 const target = asCall ? this.nodeById(asCall.targetNodeId) : undefined;
1808 if (!asCall || !target || (target.kind !== 'function' && target.kind !== 'method')) return null;
1809 if (isRustTraitImplMember(target, this.context)) return null;
1810 const segments = ref.referenceName.split('::');
1811 if (isRustOtherTypesMethod(target, segments[segments.length - 2]!.replace(/^r#/, ''), this.context)) return null;
1812 return { original: ref, targetNodeId: target.id, confidence: asCall.confidence, resolvedBy: 'function-ref' };
1813 }
1814
1815 private resolveOneInner(ref: UnresolvedRef): ResolvedRef | null {
1816 // A local C++ object construction (`T obj(args)`, ref `ns::T::T/1`)

Callers 1

resolveOneInMethod · 0.95

Calls 2

resolveOneInMethod · 0.95
nodeByIdMethod · 0.95

Tested by

no test coverage detected