mirror of
https://github.com/github/semantic.git
synced 2024-12-26 08:25:19 +03:00
Merge pull request #461 from github/split-diffs-contain-tree-costs
Attach term sizes to patches in the split diff.
This commit is contained in:
commit
cece8416c8
@ -124,7 +124,7 @@ instance ToMarkup (Renderable (SplitDiff a Info)) where
|
||||
toMarkup (Renderable (source, diff)) = fst $ iter (\ (Annotated info@(Info range _) syntax) -> (toMarkup $ Renderable (source, (info, syntax)), range)) $ toMarkupAndRange <$> diff
|
||||
where toMarkupAndRange :: SplitPatch (Term a Info) -> (Markup, Range)
|
||||
toMarkupAndRange patch = let term@(Info range _ :< _) = getSplitTerm patch in
|
||||
((div ! A.class_ (splitPatchToClassName patch)) . toMarkup $ Renderable (source, term), range)
|
||||
((div ! A.class_ (splitPatchToClassName patch) ! A.data_ (stringValue . show $ termSize term)) . toMarkup $ Renderable (source, term), range)
|
||||
|
||||
-- | Pick the class name for a split patch.
|
||||
splitPatchToClassName :: SplitPatch a -> AttributeValue
|
||||
|
Loading…
Reference in New Issue
Block a user