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

Function isCodeGraphRow

src/installer/targets/dsh.ts:162–167  ·  view source on GitHub ↗

Whether a row is CodeGraph's server, by its own `name:`, not one nested in a group's `config`.

(lines: string[], row: Range)

Source from the content-addressed store, hash-verified

160
161/** Whether a row is CodeGraph's server, by its own `name:`, not one nested in a group's `config`. */
162function isCodeGraphRow(lines: string[], row: Range): boolean {
163 const body = lines.slice(row.start, row.end).filter((line) => !isTrivia(line));
164 if (!body.some((line) => NAMES_SERVER.test(line))) return false;
165 const keyIndent = indentOf(body[0]!.replace('-', ' '));
166 return body.some((line, i) => (i === 0 || indentOf(line) === keyIndent) && NAMES_CLIENT.test(line));
167}
168
169function hasServer(lines: string[]): boolean {
170 return lines.some((line) => !isTrivia(line) && NAMES_SERVER.test(line));

Callers 1

removeRowsFunction · 0.85

Calls 2

isTriviaFunction · 0.85
indentOfFunction · 0.70

Tested by

no test coverage detected