MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / processHunks

Function processHunks

webview-ui/src/components/common/DiffView.tsx:112–138  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110 }
111
112 const processHunks = async () => {
113 const processed: Hunk[] = []
114
115 for (let i = 0; i < hunks.length; i++) {
116 const hunk = hunks[i]
117 try {
118 const highlighted = await highlightHunks(
119 hunk.oldText,
120 hunk.newText,
121 normalizedLang,
122 isLightTheme ? "light" : "dark",
123 i,
124 filePath,
125 )
126 processed.push({
127 ...hunk,
128 highlightedOldLines: highlighted.oldLines,
129 highlightedNewLines: highlighted.newLines,
130 })
131 } catch {
132 // Fall back to unhighlighted on error
133 processed.push(hunk)
134 }
135 }
136
137 setProcessedHunks(processed)
138 }
139
140 processHunks()
141 }, [hunks, shouldHighlight, normalizedLang, isLightTheme, filePath])

Callers 1

DiffView.tsxFile · 0.85

Calls 1

highlightHunksFunction · 0.90

Tested by

no test coverage detected