@@ -13,11 +13,12 @@ import type { Fixture, Highlight, RangeType, RangeTypeColors } from "./types";
1313export function generateDecorations (
1414 fixture : Fixture ,
1515 rangeType : RangeType ,
16+ isIteration : boolean ,
1617) : DecorationItem [ ] {
1718 const { domainRanges, targetRanges } = getRanges ( fixture , rangeType ) ;
1819
1920 const codeLineRanges = getCodeLineRanges ( fixture . code ) ;
20- const colors = getColors ( rangeType ) ;
21+ const colors = getColors ( rangeType , isIteration ) ;
2122
2223 const domainDecorations = getDecorations ( codeLineRanges , domainRanges ) ;
2324 const targetRangeDecorations = getDecorations ( codeLineRanges , targetRanges ) ;
@@ -37,13 +38,19 @@ export function generateDecorations(
3738 return highlightsToDecorations ( highlights ) ;
3839}
3940
40- function getColors ( rangeType : RangeType ) {
41+ function getColors ( rangeType : RangeType , isIteration : boolean ) {
42+ const target = ( ( ) => {
43+ if ( isIteration ) {
44+ return highlightColors . iteration ;
45+ }
46+ if ( rangeType === "content" ) {
47+ return highlightColors . content ;
48+ }
49+ return highlightColors . removal ;
50+ } ) ( ) ;
4151 return {
4252 domain : highlightColors . domain ,
43- target :
44- rangeType === "content"
45- ? highlightColors . content
46- : highlightColors . removal ,
53+ target,
4754 } ;
4855}
4956
0 commit comments