Commit graph

17 commits

Author SHA1 Message Date
Vidar Holen
2a16a4e8c1 Add missing imports for later GHC versions 2022-12-10 15:17:08 -08:00
Vidar Holen
4a27c9a8d5 Fix overlap check 2022-07-26 15:33:25 -07:00
Vidar Holen
b5f5e6347d Discard next rather than existing fixes when they overlap 2022-07-26 13:41:22 -07:00
Vidar Holen
f77a545282 Control Flow Graph / Data Flow Analysis support 2022-07-20 08:08:24 -07:00
Joseph C. Sible
d45ab327b0 Only perform the comparisons once 2020-04-05 19:45:28 -04:00
Joseph C. Sible
8a005526cc Use drop instead of splitAt since we only use the second half 2020-02-01 23:04:04 -05:00
Joseph C. Sible
e6e89d68fd Use list comprehensions instead of clunky combinations of map and filter 2020-02-01 23:04:04 -05:00
Vidar Holen
fd2beaadfa Make Fixer responsible for realigning tab stops 2019-01-09 18:08:59 -08:00
Vidar Holen
df7f00eaed Remove duplicate pathTo and unused replaceMultiLines 2019-01-09 17:51:43 -08:00
Vidar Holen
434b904746 Process replacements according to AST depth (fixes #1431) 2019-01-08 18:25:37 -08:00
Ng Zhi An
461be74976 Realign virtual tabs when applying fix
Fix an off-by-one error, in the case that is commented `should never happen`.
It happens when the end of a range is the at the end of a line.
In that case we should update the real column count (probably just by +1)
instead of returning it.

I modified makeNonVirtual to use a helper, realign, that works on
Ranged. That way we can share the code to realign a PositionedComment
and also a Replacement.

Fixes #1420
2018-12-29 17:16:29 +08:00
Vidar Holen
9acc8fcb53 Fix semigroup incompatibility 2018-12-23 11:08:48 -08:00
Vidar Holen
897f019353 Move Ranged definition to Fixer to avoid overpromising 2018-12-22 10:04:00 -08:00
Ng Zhi An
0636e7023c Fix applying multiple fixes per line
Fixes #1421
2018-12-21 14:34:03 +08:00
Ng Zhi An
3403f8d75b Fix bug in overlap check 2018-12-17 00:20:50 -08:00
Ng Zhi An
408a3b99d8 Remove overlaps before applying replacements 2018-12-17 00:20:50 -08:00
Ng Zhi An
bc111141f8 Move fix application logic to separate module 2018-12-17 00:20:50 -08:00