mirror of
https://github.com/github/semantic.git
synced 2024-12-22 22:31:36 +03:00
Span over the mergeable children.
This commit is contained in:
parent
b4c75c7f55
commit
133c69ec92
@ -135,7 +135,7 @@ groupChildrenByLine :: Join These [Range] -> [AlignedDiff leaf] -> [Join These (
|
||||
groupChildrenByLine ranges children = go (fromThese [] [] $ runJoin ranges) children
|
||||
where go :: ([Range], [Range]) -> [AlignedDiff leaf] -> [Join These (Range, [SplitDiff leaf Info])]
|
||||
go ranges children | (l:ls, r:rs) <- ranges
|
||||
, (intersectingChildren, rest) <- span (or . intersects l r) children
|
||||
, (intersectingChildren, rest) <- spanMergeable l r children
|
||||
= Join (uncurry These $ bimap ((,) l . catMaybes) ((,) r . catMaybes) (unalign $ runJoin <$> join intersectingChildren)) : go (ls, rs) rest
|
||||
| otherwise = uncurry (alignWith (fmap (flip (,) []) . Join)) ranges
|
||||
getRange (Free (Annotated (Info range _) _)) = range
|
||||
|
Loading…
Reference in New Issue
Block a user