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

Function pylsp_prefix_scan

tests/test_py_lsp.c:3905–3917  ·  view source on GitHub ↗

The prefix index is an existence oracle, never an exact-symbol selector. */

Source from the content-addressed store, hash-verified

3903
3904/* The prefix index is an existence oracle, never an exact-symbol selector. */
3905static bool pylsp_prefix_scan(const CBMTypeRegistry *reg, const char *prefix) {
3906 if (!reg || !prefix)
3907 return false;
3908 CBMFreeFuncIter iter;
3909 cbm_registry_all_funcs_chain(reg, &iter);
3910 size_t length = strlen(prefix);
3911 for (int i; (i = cbm_free_func_iter_next(&iter)) >= 0;) {
3912 const char *qn = iter.reg->funcs[i].qualified_name;
3913 if (qn && strncmp(qn, prefix, length) == 0)
3914 return true;
3915 }
3916 return false;
3917}
3918
3919static bool pylsp_prefix_add(CBMTypeRegistry *reg, const char *qn, const char *receiver) {
3920 int before = reg->func_count;

Callers 2

pylsp_prefix_oraclesFunction · 0.85
test_py_lsp.cFile · 0.85

Calls 2

cbm_free_func_iter_nextFunction · 0.85

Tested by

no test coverage detected