mirror of
https://github.com/github/semantic.git
synced 2024-11-24 17:04:47 +03:00
Compute the aligned children from a list of branch elements.
This commit is contained in:
parent
e4dd1e7cd8
commit
f720901dbc
@ -204,6 +204,11 @@ toSourcesAndRanges elements = (sources, Source.actualLineRanges <$> totalRanges
|
||||
where sources = toSources elements
|
||||
totalRanges = totalRange <$> sources
|
||||
|
||||
toAlignedChildren :: [BranchElement] -> [(String, [Join These String])]
|
||||
toAlignedChildren elements = elements >>= go
|
||||
where go child@(Child key contents) = [ (key, branchElementContents <$> alignBranchElement child) ]
|
||||
go (Margin _) = []
|
||||
|
||||
instance Arbitrary BranchElement where
|
||||
arbitrary = oneof [ key >>= \ key -> Child key <$> joinTheseOf (contents key)
|
||||
, Margin <$> joinTheseOf margin ]
|
||||
|
Loading…
Reference in New Issue
Block a user