MCPcopy
hub / github.com/code-hike/codehike / compatAnnotations

Function compatAnnotations

packages/codehike/src/code/highlight.ts:62–88  ·  view source on GitHub ↗
(annotations: any[])

Source from the content-addressed store, hash-verified

60}
61
62function compatAnnotations(annotations: any[]): CodeAnnotation[] {
63 const newAnnotations: CodeAnnotation[] = []
64 for (const a of annotations) {
65 const { name, query, ranges } = a
66 for (const r of ranges) {
67 if (r.lineNumber) {
68 const { lineNumber, fromColumn, toColumn } = r
69 newAnnotations.push({
70 name,
71 query,
72 lineNumber,
73 fromColumn,
74 toColumn,
75 })
76 } else {
77 const { fromLineNumber, toLineNumber } = r
78 newAnnotations.push({
79 name,
80 query,
81 fromLineNumber,
82 toLineNumber,
83 })
84 }
85 }
86 }
87 return newAnnotations
88}
89
90// group the Lines into one array
91function joinLines(lines: Lines): AnyToken[] {

Callers 1

highlightFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…