MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / jr_java_method

Function jr_java_method

src/pipeline/doc_links_jvm.c:2827–2857  ·  view source on GitHub ↗

A method reference's outcome from javadoc's search `w` from `base`; `vs`: * the field search that came first, if any. A search that ended at a method * javadoc would link that the repository does not show is external; when a * method of the repository lies further on, the count says so. */

Source from the content-addressed store, hash-verified

2825 * javadoc would link that the repository does not show is external; when a
2826 * method of the repository lies further on, the count says so. */
2827static jr_res_t jr_java_method(const jr_ctx_t *c, int base, const char *name, int sel,
2828 const jr_ref_t *r, const jr_walk_t *w, const jr_msearch_t *vs,
2829 bool exact) {
2830 if (w->kind == JR_WK_FOUND) {
2831 /* without a list, several signatures are an overload group */
2832 return (!(sel & JR_SEL_SIG) && w->found.several) ? jr_unres(CBM_DOCLINK_REASON_AMBIGUOUS)
2833 : jr_found_result(&w->found, exact);
2834 }
2835 if (w->kind == JR_WK_GAP) {
2836 return jr_unres(CBM_DOCLINK_REASON_GRAPH_GAP);
2837 }
2838 if (w->invisible || (vs && vs->invisible)) {
2839 return jr_unres(CBM_DOCLINK_REASON_TEST_ONLY);
2840 }
2841 if (w->kind == JR_WK_UNCOMPARED || w->kind == JR_WK_LIMIT) {
2842 return jr_unres(CBM_DOCLINK_REASON_AMBIGUOUS);
2843 }
2844 if (w->kind == JR_WK_GIVEN || w->kind == JR_WK_OUTSIDE) {
2845 jr_walk_t further;
2846 jr_walk(c, base, name, sel, r, JR_NONE, true, &further);
2847 if (further.kind == JR_WK_FOUND) {
2848 jr_stats_t *st = c->ix->stats;
2849 atomic_fetch_add(w->kind == JR_WK_GIVEN ? &st->java_given : &st->java_open, 1);
2850 }
2851 return jr_unres(CBM_DOCLINK_REASON_EXTERNAL);
2852 }
2853 if (jr_implicit_member(c->ix, base, name) || (vs && vs->open)) {
2854 return jr_unres(CBM_DOCLINK_REASON_EXTERNAL);
2855 }
2856 return jr_unres(CBM_DOCLINK_REASON_MISSING);
2857}
2858
2859/* A field `vs` that javadoc's field search found for a reference without a
2860 * parameter list, weighed against javadoc's search for a METHOD of the name

Callers 1

jr_java_memberFunction · 0.85

Calls 4

jr_unresFunction · 0.85
jr_found_resultFunction · 0.85
jr_walkFunction · 0.85
jr_implicit_memberFunction · 0.85

Tested by

no test coverage detected