mirror of
https://github.com/github/semantic.git
synced 2024-12-23 06:41:45 +03:00
Aligned leaf diffs have per-line ranges.
This commit is contained in:
parent
73f8cd56e0
commit
2f37ba14bc
@ -122,7 +122,7 @@ alignDiff :: Both (Source Char) -> Diff leaf Info -> AlignedDiff leaf
|
||||
alignDiff sources diff = iter alignSyntax (alignPatch sources <$> diff)
|
||||
where alignSyntax :: Annotated leaf (Both Info) (AlignedDiff leaf) -> AlignedDiff leaf
|
||||
alignSyntax (Annotated infos syntax) = case syntax of
|
||||
Leaf s -> runBothWith ((Join .) . These) $ (\ info -> (Free (Annotated info (Leaf s)) <$)) <$> infos <*> lineRanges
|
||||
Leaf s -> runBothWith ((Join .) . These) $ (\ info -> fmap (Free . (`Annotated` Leaf s) . setCharacterRange info)) <$> infos <*> lineRanges
|
||||
_ -> Join (These [] [])
|
||||
where lineRanges = actualLineRanges <$> (characterRange <$> infos) <*> sources
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user