facebookincubator / fastmod

A fast partial replacement for the codemod tool
Apache License 2.0
1.68k stars 42 forks source link

Feature request: match and replacement word highlighting within the replacement preview diff #46

Open LeoniePhiline opened 11 months ago

LeoniePhiline commented 11 months ago

At times, a line contains multiple matches.

Fastmod thus presents the line multiple times, once for each match and replacement within the line.

It can be difficult to see where exactly something is being replaced, especially when replacing matches in very long lines. (think minification test fixtures, but much shorter lines can also benefit from word highlighting)

A rather extreme example (pixellated, but the point should become obvious): grafik

The individual match and replacement should be highlighted within the red and green lines.