1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 00:33:59 +03:00

Combine all the JSONGraphDiff instances.

This commit is contained in:
Rob Rix 2019-10-18 23:07:10 -04:00
parent 200b7bcf99
commit a124842b83
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -114,6 +114,9 @@ jsonGraphDiffParsers = aLaCarteParsers
class JSONGraphDiff term where
jsonGraphDiff :: (Carrier sig m, Member Telemetry sig, MonadIO m) => Edit (Blob, term Loc) (Blob, term Loc) -> m DiffTreeFileGraph
instance (DiffTerms term, ConstructorName (Syntax term), Foldable (Syntax term), Functor (Syntax term)) => JSONGraphDiff term where
jsonGraphDiff terms = toGraph (bimap fst fst terms) <$> diffTerms terms
toGraph
:: (Recursive diff, ToTreeGraph DiffTreeVertex (Base diff))
=> BlobPair
@ -131,21 +134,6 @@ toGraph blobPair diff =
& P.edges .~ fmap toEdge (edgeList graph)
& P.errors .~ mempty
instance JSONGraphDiff Go.Term where
jsonGraphDiff terms = toGraph (bimap fst fst terms) <$> diffTerms terms
instance JSONGraphDiff Markdown.Term where
jsonGraphDiff terms = toGraph (bimap fst fst terms) <$> diffTerms terms
instance JSONGraphDiff PHP.Term where
jsonGraphDiff terms = toGraph (bimap fst fst terms) <$> diffTerms terms
instance JSONGraphDiff Python.Term where
jsonGraphDiff terms = toGraph (bimap fst fst terms) <$> diffTerms terms
instance JSONGraphDiff Ruby.Term where
jsonGraphDiff terms = toGraph (bimap fst fst terms) <$> diffTerms terms
instance JSONGraphDiff TSX.Term where
jsonGraphDiff terms = toGraph (bimap fst fst terms) <$> diffTerms terms
instance JSONGraphDiff TypeScript.Term where
jsonGraphDiff terms = toGraph (bimap fst fst terms) <$> diffTerms terms
jsonTreeDiffParsers :: Map Language (SomeParser JSONTreeDiff Loc)
jsonTreeDiffParsers = aLaCarteParsers