| 20 | `; Generated from ${source} by scripts/writeHelix.ts; edit that instead.\n\n` |
| 21 | |
| 22 | const highlights = () => { |
| 23 | const blocks = read("queries/highlights.scm").split(/\n(?=\n)/) |
| 24 | return ( |
| 25 | header("queries/highlights.scm") + |
| 26 | blocks |
| 27 | .filter(block => { |
| 28 | const capture = block.match(/@([\w.]+)\s*$/)?.[1] |
| 29 | return !(capture && helixCaptures[capture] === null) |
| 30 | }) |
| 31 | .map(block => |
| 32 | block.replace(/@([\w.]+)/g, (whole, capture: string) => |
| 33 | helixCaptures[capture] ? `@${helixCaptures[capture]}` : whole |
| 34 | ) |
| 35 | ) |
| 36 | .join("\n") |
| 37 | .trim() + |
| 38 | "\n" |
| 39 | ) |
| 40 | } |
| 41 | |
| 42 | // Helix's own injections.scm for each host, plus `_arktype` |
| 43 | const hostInherits: Record<string, string> = { |