Whether a row is CodeGraph's server, by its own `name:`, not one nested in a group's `config`.
(lines: string[], row: Range)
| 160 | |
| 161 | /** Whether a row is CodeGraph's server, by its own `name:`, not one nested in a group's `config`. */ |
| 162 | function 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 | |
| 169 | function hasServer(lines: string[]): boolean { |
| 170 | return lines.some((line) => !isTrivia(line) && NAMES_SERVER.test(line)); |
no test coverage detected