1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 18:23:44 +03:00

Remove BranchInfo for If Syntaxes

Although this allowed us to report a list of summary statements for
each if / else-if condition, we don’t append parent contexts to
Patches. Because we lose that parent context, it makes replacement
summary statements devoid of context. Taking a step back, @joshvera and
I decided to leave if summary statements as they are now, but revisit
this when we explore rollups. Although diff summary statements do not
include else-if clauses now in Syntax If accurately. So we have the
info, but as it stands, a long list of summary statements for each
else-if clause we determined to be less helpful, but will set us up for
success when we add rollups.
This commit is contained in:
Rick Winfrey 2016-10-13 16:42:49 -05:00
parent 59a2531889
commit 5cc26fcc34

View File

@ -242,7 +242,6 @@ termToDiffInfo blob term = case unwrap term of
S.Fixed children -> BranchInfo (termToDiffInfo' <$> children) (toCategoryName term) BFixed
S.AnonymousFunction _ _ -> LeafInfo "anonymous function" (toTermName' term) (getField $ extract term)
Commented cs leaf -> BranchInfo (termToDiffInfo' <$> cs <> maybeToList leaf) (toCategoryName term) BCommented
S.If _ _ elseIfs -> BranchInfo ([toLeafInfo term] <> (termToDiffInfo' <$> elseIfs)) (toCategoryName term) BIf
S.Error _ -> ErrorInfo (getField $ extract term) (toTermName' term)
_ -> toLeafInfo term
where toTermName' = toTermName blob