mirror of
https://github.com/github/semantic.git
synced 2024-12-23 06:41:45 +03:00
Add a convenience to modify the contents of a Join.
This commit is contained in:
parent
ea97b04032
commit
d118070186
@ -143,6 +143,9 @@ groupChildrenByLine ranges children = go (fromThese [] [] $ runJoin ranges) chil
|
||||
getRange (Free (Annotated (Info range _) _)) = range
|
||||
getRange (Pure patch) | Info range _ :< _ <- getSplitTerm patch = range
|
||||
|
||||
modifyJoin :: (p a a -> p b b) -> Join p a -> Join p b
|
||||
modifyJoin f = Join . f . runJoin
|
||||
|
||||
intersects :: Range -> Range -> Bool
|
||||
intersects a b = max (start a) (start b) < min (end a) (end b)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user