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

Method cappedList

src/mcp/tools.ts:4678–4685  ·  view source on GitHub ↗
(words: string[], cap: number)

Source from the content-addressed store, hash-verified

4676 // Separate caps preserve the retry instruction and complete candidate
4677 // names even with long queries or generated identifiers.
4678 const cappedList = (words: string[], cap: number) => {
4679 const kept: string[] = [];
4680 for (const word of words) {
4681 if (list([...kept, word]).length > cap) break;
4682 kept.push(word);
4683 }
4684 return list(kept) + (kept.length < words.length ? ' …' : '');
4685 };
4686 explanation += '\nChecked indexed names, signatures, docstrings (FTS prefixes) and live name segments; not all source text.';
4687 if (miss.limited) explanation += '\nWord check limited to 16 words of at most 64 characters.';
4688 explanation += `\nNo lexical matches for checked words: ${cappedList(miss.unmatched, 250) || '(none)'}.`;

Callers

nothing calls this directly

Calls 2

pushMethod · 0.80
listFunction · 0.50

Tested by

no test coverage detected