1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 02:44:36 +03:00

New maybeParentContext for updated assignment phrasing

This commit is contained in:
Timothy Clem 2016-09-20 11:04:20 -07:00
parent b5c45f8c7c
commit 3a04ffd85a

View File

@ -176,8 +176,12 @@ toTermName source term = case unwrap term of
Unidentifiable _ -> ""
maybeParentContext :: Maybe (Category, Text) -> Doc
maybeParentContext = maybe "" (\annotation ->
space P.<> "in the" <+> (toDoc $ snd annotation) <+> toDoc (toCategoryName $ fst annotation))
maybeParentContext = maybe "" go
where go (c, t) = case c of
C.Assignment -> space P.<> "in an" <+> catName <+> "to" <+> termName
_ -> space P.<> "in the" <+> termName <+> catName
where catName = toDoc $ toCategoryName c
termName = toDoc t
toDoc :: Text -> Doc
toDoc = string . toS