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

Function snippetAround

src/mcp/dynamic-boundaries.ts:392–398  ·  view source on GitHub ↗

The full source line containing `index`, trimmed and capped for display.

(text: string, index: number)

Source from the content-addressed store, hash-verified

390
391/** The full source line containing `index`, trimmed and capped for display. */
392function snippetAround(text: string, index: number): string {
393 const lineStart = text.lastIndexOf('\n', index) + 1;
394 let lineEnd = text.indexOf('\n', index);
395 if (lineEnd === -1) lineEnd = text.length;
396 const line = text.slice(lineStart, lineEnd).trim();
397 return line.length > 120 ? line.slice(0, 117) + '...' : line;
398}

Callers 2

scanDynamicDispatchFunction · 0.85
scanPythonGetattrFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected