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

Function pylsp_range_oracle

tests/test_py_lsp.c:4317–4335  ·  view source on GitHub ↗

No fixed result buffer and no call to the implementation's member predicate. */

Source from the content-addressed store, hash-verified

4315
4316/* No fixed result buffer and no call to the implementation's member predicate. */
4317static bool pylsp_range_oracle(const CBMTypeRegistry *reg, bool types, const char *prefix,
4318 bool direct, CBMArena *scratch, uint64_t *visits) {
4319 CBMQNPrefixIter it;
4320 bool opened = types ? cbm_registry_types_with_qn_prefix(reg, prefix, direct, scratch, &it)
4321 : cbm_registry_funcs_with_qn_prefix(reg, prefix, direct, scratch, &it);
4322 if (!opened)
4323 return false;
4324 int total = reg ? (types ? reg->type_count : reg->func_count) : 0;
4325 bool ok = true;
4326 for (int i = 0; i < total; i++) {
4327 const char *qn = types ? reg->types[i].qualified_name : reg->funcs[i].qualified_name;
4328 if (pylsp_range_member(qn, prefix, direct))
4329 ok = cbm_qn_prefix_iter_next(&it) == i && ok;
4330 }
4331 ok = cbm_qn_prefix_iter_next(&it) == -1 && cbm_qn_prefix_iter_next(&it) == -1 && ok;
4332 if (visits)
4333 *visits = it.visits;
4334 return ok;
4335}
4336
4337static void pylsp_range_reset_failures(void) {
4338 cbm_registry_test_type_qn_order_fail_after(-1);

Callers 1

test_py_lsp.cFile · 0.85

Tested by

no test coverage detected