1
1
mirror of https://github.com/github/semantic.git synced 2024-12-25 16:02:43 +03:00

Unpack the rows.

This commit is contained in:
Rob Rix 2016-03-01 14:42:14 -05:00
parent 5304663642
commit 94f97ba366

View File

@ -29,9 +29,10 @@ import Term
-- | Render a diff to a string representing its JSON.
json :: Renderer a ByteString
json diff sources = toLazyByteString . fromEncoding . pairs $
"rows" .= Prelude.fst (splitDiffByLines diff (pure 0) (source <$> sources))
"rows" .= annotateRows (Prelude.fst (splitDiffByLines diff (pure 0) (source <$> sources)))
<> "oids" .= (oid <$> sources)
<> "paths" .= (path <$> sources)
where annotateRows = fmap unRow
instance ToJSON Category where
toJSON (Other s) = String $ T.pack s