mirror of
https://github.com/github/semantic.git
synced 2025-01-03 13:02:37 +03:00
Use record syntax to update info.
This commit is contained in:
parent
e5dd029b10
commit
3e1072f714
@ -133,7 +133,7 @@ alignSyntax toJoinThese sources infos syntax = case syntax of
|
|||||||
Fixed children -> catMaybes $ wrapInBranch Fixed <$> groupChildrenByLine lineRanges children
|
Fixed children -> catMaybes $ wrapInBranch Fixed <$> groupChildrenByLine lineRanges children
|
||||||
_ -> []
|
_ -> []
|
||||||
where lineRanges = toJoinThese $ actualLineRanges <$> (characterRange <$> infos) <*> sources
|
where lineRanges = toJoinThese $ actualLineRanges <$> (characterRange <$> infos) <*> sources
|
||||||
wrapInBranch constructor = applyThese $ toJoinThese ((\ info (range, children) -> Free (Annotated (setCharacterRange info range) (constructor children))) <$> infos)
|
wrapInBranch constructor = applyThese $ toJoinThese ((\ info (range, children) -> Free (Annotated (info { characterRange = range }) (constructor children))) <$> infos)
|
||||||
|
|
||||||
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 | not (and $ null <$> ranges)
|
groupChildrenByLine ranges children | not (and $ null <$> ranges)
|
||||||
|
Loading…
Reference in New Issue
Block a user