MCPcopy Create free account
hub / github.com/PatrickSys/codebase-context / generateSnippet

Method generateSnippet

src/core/search.ts:1070–1079  ·  view source on GitHub ↗
(content: string, maxLines: number = 20)

Source from the content-addressed store, hash-verified

1068 }
1069
1070 private generateSnippet(content: string, maxLines: number = 20): string {
1071 const lines = content.split('\n');
1072 if (lines.length <= maxLines) {
1073 return content;
1074 }
1075
1076 const snippet = lines.slice(0, maxLines).join('\n');
1077 const remaining = lines.length - maxLines;
1078 return `${snippet}\n\n... [${remaining} more lines]`;
1079 }
1080
1081 private async semanticSearch(
1082 query: string,

Callers 1

scoreAndSortResultsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected