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

Function statement

graph-ui/src/browser-ai/code-facts.ts:50–54  ·  view source on GitHub ↗

The statement starting at `start`, joined over the lines its brackets keep open.

(lines: readonly string[], start: number)

Source from the content-addressed store, hash-verified

48
49/** The statement starting at `start`, joined over the lines its brackets keep open. */
50function statement(lines: readonly string[], start: number): { text: string; end: number } {
51 let text = lines[start].trim(), end = start;
52 while (openBrackets(text) > 0 && end + 1 < lines.length && end - start < 8) text += ` ${lines[++end].trim()}`;
53 return { text: text.replace(/([([{])\s+/g, '$1').replace(/\s+([)\]}])/g, '$1').replace(/,([)\]}])/g, '$1'), end };
54}
55
56/** The first line of a docstring right after line `after`, as it is written (one or two lines). */
57function docstring(lines: readonly string[], after: number, indent: string): string[] {

Callers 1

pythonFactsFunction · 0.85

Calls 1

openBracketsFunction · 0.70

Tested by

no test coverage detected