MCPcopy Create free account
hub / github.com/arktypeio/arktype / highlights

Function highlights

ark/tree-sitter/scripts/writeHelix.ts:22–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20 `; Generated from ${source} by scripts/writeHelix.ts; edit that instead.\n\n`
21
22const 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`
43const hostInherits: Record<string, string> = {

Callers 1

helixOutputsFunction · 0.85

Calls 6

filterMethod · 0.80
matchMethod · 0.80
replaceMethod · 0.80
readFunction · 0.70
headerFunction · 0.70
mapMethod · 0.65

Tested by

no test coverage detected