* 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)
| 1847 | * inherent method (isRustOtherTypesMethod). |
| 1848 | */ |
| 1849 | private resolveRustPathValue(ref: UnresolvedRef): ResolvedRef | null { |
| 1850 | const asCall = this.resolveOneIn({ ...ref, referenceKind: 'calls' }); |
| 1851 | const target = asCall ? this.nodeById(asCall.targetNodeId) : undefined; |
| 1852 | if (!asCall || !target || (target.kind !== 'function' && target.kind !== 'method')) return null; |
| 1853 | if (isRustTraitImplMember(target, this.context)) return null; |
| 1854 | const segments = ref.referenceName.split('::'); |
| 1855 | if (isRustOtherTypesMethod(target, segments[segments.length - 2]!.replace(/^r#/, ''), this.context)) return null; |
| 1856 | return { original: ref, targetNodeId: target.id, confidence: asCall.confidence, resolvedBy: 'function-ref' }; |
| 1857 | } |
| 1858 | |
| 1859 | private resolveOneInner(ref: UnresolvedRef): ResolvedRef | null { |
| 1860 | // A local C++ object construction (`T obj(args)`, ref `ns::T::T/1`) |
no test coverage detected