mirror of
https://github.com/github/semantic.git
synced 2024-12-23 06:41:45 +03:00
Rename heads/tails to headRanges/tailRanges.
This commit is contained in:
parent
55742ac947
commit
35d60f8517
@ -132,14 +132,14 @@ alignDiff sources diff = iter alignSyntax (alignPatch sources <$> diff)
|
|||||||
where lineRanges = runBothWith ((Join .) . These) (actualLineRanges <$> (characterRange <$> infos) <*> sources)
|
where lineRanges = runBothWith ((Join .) . These) (actualLineRanges <$> (characterRange <$> infos) <*> sources)
|
||||||
|
|
||||||
groupChildrenByLine :: Join These [Range] -> [AlignedDiff leaf] -> [Join These (Range, [SplitDiff leaf Info])]
|
groupChildrenByLine :: Join These [Range] -> [AlignedDiff leaf] -> [Join These (Range, [SplitDiff leaf Info])]
|
||||||
groupChildrenByLine ranges children | Just (heads, tails) <- unconsThese ranges
|
groupChildrenByLine ranges children | Just (headRanges, tailRanges) <- unconsThese ranges
|
||||||
, (intersectingChildren, rest) <- spanMergeable heads children
|
, (intersectingChildren, rest) <- spanMergeable headRanges children
|
||||||
, ~(intersectingChildrenL, intersectingChildrenR) <- bimap catMaybes catMaybes (unalign $ runJoin <$> join intersectingChildren)
|
, ~(intersectingChildrenL, intersectingChildrenR) <- bimap catMaybes catMaybes (unalign $ runJoin <$> join intersectingChildren)
|
||||||
= (case runJoin heads of
|
= (case runJoin headRanges of
|
||||||
This l -> Join $ This (l, intersectingChildrenL)
|
This l -> Join $ This (l, intersectingChildrenL)
|
||||||
That r -> Join $ That (r, intersectingChildrenR)
|
That r -> Join $ That (r, intersectingChildrenR)
|
||||||
These l r -> Join $ These (l, intersectingChildrenL) (r, intersectingChildrenR))
|
These l r -> Join $ These (l, intersectingChildrenL) (r, intersectingChildrenR))
|
||||||
: groupChildrenByLine tails rest
|
: groupChildrenByLine tailRanges rest
|
||||||
| otherwise = []
|
| otherwise = []
|
||||||
|
|
||||||
unconsThese :: Join These [a] -> Maybe (Join These a, Join These [a])
|
unconsThese :: Join These [a] -> Maybe (Join These a, Join These [a])
|
||||||
|
Loading…
Reference in New Issue
Block a user