()
| 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]) |
no test coverage detected