From c0cce3b13bfb15eee4bde76aab25c709f35fd86b Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Fri, 27 Sep 2019 16:42:12 -0700 Subject: [PATCH 01/13] First pass at switching from proto3 to proto-lens --- cabal.project | 9 +- proto/semantic.proto | 3 - semantic.cabal | 9 +- src/Data/Graph.hs | 8 +- src/Proto/Semantic.hs | 2619 ++++++++++++++++++++++++++++++ src/Proto/Semantic_Fields.hs | 423 +++++ src/Rendering/Graph.hs | 57 +- src/Semantic/Api.hs | 2 +- src/Semantic/Api/Bridge.hs | 31 +- src/Semantic/Api/Diffs.hs | 29 +- src/Semantic/Api/Symbols.hs | 42 +- src/Semantic/Api/TOCSummaries.hs | 43 +- src/Semantic/Api/Terms.hs | 31 +- src/Semantic/CLI.hs | 6 +- src/Serializing/Format.hs | 8 +- 15 files changed, 3224 insertions(+), 96 deletions(-) create mode 100644 src/Proto/Semantic.hs create mode 100644 src/Proto/Semantic_Fields.hs diff --git a/cabal.project b/cabal.project index b04f9924a7..7c80b50dd2 100644 --- a/cabal.project +++ b/cabal.project @@ -4,10 +4,5 @@ jobs: $ncpus source-repository-package type: git - location: https://github.com/joshvera/proto3-suite.git - tag: 83f3352f0c7c94ea091e6087f60692eda9991fae - -source-repository-package - type: git - location: https://github.com/joshvera/proto3-wire.git - tag: 84664e22f01beb67870368f1f88ada5d0ad01f56 + location: https://github.com/tclem/proto-lens-json + tag: 6b56fa64c2a2edad6dd460a97650327cb4c6361c diff --git a/proto/semantic.proto b/proto/semantic.proto index 0295f50f51..76e62835af 100644 --- a/proto/semantic.proto +++ b/proto/semantic.proto @@ -1,10 +1,7 @@ syntax = "proto3"; -import "pkg/gen/haskell/haskell.proto"; - package github.semantic; -option (haskell.haskell_package) = "Semantic.Proto"; option ruby_package = "Semantic::Proto"; message PingRequest { diff --git a/semantic.cabal b/semantic.cabal index 83aa6404c8..2e1d91fe9b 100644 --- a/semantic.cabal +++ b/semantic.cabal @@ -71,8 +71,10 @@ common dependencies , text ^>= 1.2.3.1 , these >= 0.7 && <1 , unix ^>= 2.7.2.2 - , proto3-suite - , proto3-wire + , microlens + , proto-lens == 0.4.0.1 + , proto-lens-json == 0.3.0.0 + , proto-lens-runtime == 0.4.0.2 , lingo >= 0.2.0.0 common executable-flags @@ -238,6 +240,8 @@ library -- High-level flow & operational functionality (logging, stats, etc.) , Semantic.Analysis -- API + , Proto.Semantic + , Proto.Semantic_Fields , Semantic.Api , Semantic.Api.Bridge , Semantic.Api.Diffs @@ -245,7 +249,6 @@ library , Semantic.Api.Symbols , Semantic.Api.Terms , Semantic.Api.TOCSummaries - , Semantic.Proto.SemanticPB , Semantic.AST , Semantic.CLI , Semantic.Config diff --git a/src/Data/Graph.hs b/src/Data/Graph.hs index 403a7f25f5..b225458a26 100644 --- a/src/Data/Graph.hs +++ b/src/Data/Graph.hs @@ -21,9 +21,11 @@ import Algebra.Graph.Class (connect, overlay, vertex) import qualified Algebra.Graph.Class as Class import qualified Algebra.Graph.ToGraph as Class import Control.Effect.State +import Control.Lens (view) import Data.Aeson import qualified Data.Set as Set -import Semantic.Proto.SemanticPB +import Proto.Semantic as P +import Proto.Semantic_Fields as P -- | An algebraic graph with 'Ord', 'Semigroup', and 'Monoid' instances. newtype Graph vertex = Graph { unGraph :: G.Graph vertex } @@ -100,8 +102,8 @@ instance Ord vertex => Ord (Graph vertex) where class VertexTag vertex where uniqueTag :: vertex -> Int -instance VertexTag DiffTreeVertex where uniqueTag = fromIntegral . diffVertexId -instance VertexTag TermVertex where uniqueTag = fromIntegral . vertexId +instance VertexTag DiffTreeVertex where uniqueTag = fromIntegral . view diffVertexId +instance VertexTag TermVertex where uniqueTag = fromIntegral . view vertexId instance (Ord vertex, ToJSON vertex, VertexTag vertex) => ToJSON (Graph vertex) where toJSON (Graph graph) = object ["vertices" .= G.vertexList graph, "edges" .= (Edge <$> G.edgeList graph)] diff --git a/src/Proto/Semantic.hs b/src/Proto/Semantic.hs new file mode 100644 index 0000000000..614cef6f0f --- /dev/null +++ b/src/Proto/Semantic.hs @@ -0,0 +1,2619 @@ +{- This file was auto-generated from semantic.proto by the proto-lens-protoc program. -} +{-# LANGUAGE ScopedTypeVariables, DataKinds, TypeFamilies, + UndecidableInstances, GeneralizedNewtypeDeriving, + MultiParamTypeClasses, FlexibleContexts, FlexibleInstances, + PatternSynonyms, MagicHash, NoImplicitPrelude, DataKinds #-} +{-# OPTIONS_GHC -fno-warn-unused-imports#-} +{-# OPTIONS_GHC -fno-warn-duplicate-exports#-} +module Proto.Semantic + (Blob(), BlobPair(), ChangeType(..), ChangeType(), + ChangeType'UnrecognizedValue, DeletedTerm(), DiffTreeEdge(), + DiffTreeFileGraph(), DiffTreeGraphResponse(), DiffTreeRequest(), + DiffTreeTOCResponse(), DiffTreeVertex(), + DiffTreeVertex'DiffTerm(..), _DiffTreeVertex'Deleted, + _DiffTreeVertex'Inserted, _DiffTreeVertex'Replaced, + _DiffTreeVertex'Merged, Docstring(), File(), InsertedTerm(), + MergedTerm(), ParseError(), ParseTreeFileGraph(), + ParseTreeGraphResponse(), ParseTreeRequest(), + ParseTreeSymbolResponse(), PingRequest(), PingResponse(), + Position(), ReplacedTerm(), Span(), Symbol(), TOCSummaryChange(), + TOCSummaryError(), TOCSummaryFile(), TermEdge(), TermVertex()) + where +import qualified Data.ProtoLens.Runtime.Control.DeepSeq + as Control.DeepSeq +import qualified Data.ProtoLens.Runtime.Lens.Labels.Prism + as Lens.Labels.Prism +import qualified Data.ProtoLens.Runtime.Prelude as Prelude +import qualified Data.ProtoLens.Runtime.Data.Int as Data.Int +import qualified Data.ProtoLens.Runtime.Data.Word as Data.Word +import qualified Data.ProtoLens.Runtime.Data.ProtoLens + as Data.ProtoLens +import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Message.Enum + as Data.ProtoLens.Message.Enum +import qualified + Data.ProtoLens.Runtime.Data.ProtoLens.Service.Types + as Data.ProtoLens.Service.Types +import qualified Data.ProtoLens.Runtime.Lens.Family2 + as Lens.Family2 +import qualified Data.ProtoLens.Runtime.Lens.Family2.Unchecked + as Lens.Family2.Unchecked +import qualified Data.ProtoLens.Runtime.Data.Text as Data.Text +import qualified Data.ProtoLens.Runtime.Data.Map as Data.Map +import qualified Data.ProtoLens.Runtime.Data.ByteString + as Data.ByteString +import qualified Data.ProtoLens.Runtime.Data.ByteString.Char8 + as Data.ByteString.Char8 +import qualified Data.ProtoLens.Runtime.Lens.Labels as Lens.Labels +import qualified Data.ProtoLens.Runtime.Text.Read as Text.Read + +{- | Fields : + + * 'Proto.Semantic_Fields.content' @:: Lens' Blob Data.Text.Text@ + * 'Proto.Semantic_Fields.path' @:: Lens' Blob Data.Text.Text@ + * 'Proto.Semantic_Fields.language' @:: Lens' Blob Data.Text.Text@ + -} +data Blob = Blob{_Blob'content :: !Data.Text.Text, + _Blob'path :: !Data.Text.Text, _Blob'language :: !Data.Text.Text, + _Blob'_unknownFields :: !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show Blob where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' Blob "content" (Data.Text.Text) where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _Blob'content + (\ x__ y__ -> x__{_Blob'content = y__})) + Prelude.id +instance Lens.Labels.HasLens' Blob "path" (Data.Text.Text) where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _Blob'path + (\ x__ y__ -> x__{_Blob'path = y__})) + Prelude.id +instance Lens.Labels.HasLens' Blob "language" (Data.Text.Text) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _Blob'language + (\ x__ y__ -> x__{_Blob'language = y__})) + Prelude.id +instance Data.ProtoLens.Message Blob where + messageName _ = Data.Text.pack "github.semantic.Blob" + fieldsByTag + = let content__field_descriptor + = Data.ProtoLens.FieldDescriptor "content" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "content"))) + :: Data.ProtoLens.FieldDescriptor Blob + path__field_descriptor + = Data.ProtoLens.FieldDescriptor "path" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "path"))) + :: Data.ProtoLens.FieldDescriptor Blob + language__field_descriptor + = Data.ProtoLens.FieldDescriptor "language" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "language"))) + :: Data.ProtoLens.FieldDescriptor Blob + in + Data.Map.fromList + [(Data.ProtoLens.Tag 1, content__field_descriptor), + (Data.ProtoLens.Tag 2, path__field_descriptor), + (Data.ProtoLens.Tag 3, language__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _Blob'_unknownFields + (\ x__ y__ -> x__{_Blob'_unknownFields = y__}) + defMessage + = Blob{_Blob'content = Data.ProtoLens.fieldDefault, + _Blob'path = Data.ProtoLens.fieldDefault, + _Blob'language = Data.ProtoLens.fieldDefault, + _Blob'_unknownFields = ([])} +instance Control.DeepSeq.NFData Blob where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_Blob'_unknownFields x__) + (Control.DeepSeq.deepseq (_Blob'content x__) + (Control.DeepSeq.deepseq (_Blob'path x__) + (Control.DeepSeq.deepseq (_Blob'language x__) (())))) +{- | Fields : + + * 'Proto.Semantic_Fields.before' @:: Lens' BlobPair Blob@ + * 'Proto.Semantic_Fields.maybe'before' @:: Lens' BlobPair (Prelude.Maybe Blob)@ + * 'Proto.Semantic_Fields.after' @:: Lens' BlobPair Blob@ + * 'Proto.Semantic_Fields.maybe'after' @:: Lens' BlobPair (Prelude.Maybe Blob)@ + -} +data BlobPair = BlobPair{_BlobPair'before :: !(Prelude.Maybe Blob), + _BlobPair'after :: !(Prelude.Maybe Blob), + _BlobPair'_unknownFields :: !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show BlobPair where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' BlobPair "before" (Blob) where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _BlobPair'before + (\ x__ y__ -> x__{_BlobPair'before = y__})) + (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) +instance Lens.Labels.HasLens' BlobPair "maybe'before" + (Prelude.Maybe Blob) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _BlobPair'before + (\ x__ y__ -> x__{_BlobPair'before = y__})) + Prelude.id +instance Lens.Labels.HasLens' BlobPair "after" (Blob) where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _BlobPair'after + (\ x__ y__ -> x__{_BlobPair'after = y__})) + (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) +instance Lens.Labels.HasLens' BlobPair "maybe'after" + (Prelude.Maybe Blob) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _BlobPair'after + (\ x__ y__ -> x__{_BlobPair'after = y__})) + Prelude.id +instance Data.ProtoLens.Message BlobPair where + messageName _ = Data.Text.pack "github.semantic.BlobPair" + fieldsByTag + = let before__field_descriptor + = Data.ProtoLens.FieldDescriptor "before" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor Blob) + (Data.ProtoLens.OptionalField + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'before"))) + :: Data.ProtoLens.FieldDescriptor BlobPair + after__field_descriptor + = Data.ProtoLens.FieldDescriptor "after" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor Blob) + (Data.ProtoLens.OptionalField + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'after"))) + :: Data.ProtoLens.FieldDescriptor BlobPair + in + Data.Map.fromList + [(Data.ProtoLens.Tag 1, before__field_descriptor), + (Data.ProtoLens.Tag 2, after__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _BlobPair'_unknownFields + (\ x__ y__ -> x__{_BlobPair'_unknownFields = y__}) + defMessage + = BlobPair{_BlobPair'before = Prelude.Nothing, + _BlobPair'after = Prelude.Nothing, _BlobPair'_unknownFields = ([])} +instance Control.DeepSeq.NFData BlobPair where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_BlobPair'_unknownFields x__) + (Control.DeepSeq.deepseq (_BlobPair'before x__) + (Control.DeepSeq.deepseq (_BlobPair'after x__) (()))) +newtype ChangeType'UnrecognizedValue = ChangeType'UnrecognizedValue Data.Int.Int32 + deriving (Prelude.Eq, Prelude.Ord, Prelude.Show) +data ChangeType = NONE + | ADDED + | REMOVED + | MODIFIED + | ChangeType'Unrecognized !ChangeType'UnrecognizedValue + deriving (Prelude.Show, Prelude.Eq, Prelude.Ord) +instance Data.ProtoLens.MessageEnum ChangeType where + maybeToEnum 0 = Prelude.Just NONE + maybeToEnum 1 = Prelude.Just ADDED + maybeToEnum 2 = Prelude.Just REMOVED + maybeToEnum 3 = Prelude.Just MODIFIED + maybeToEnum k + = Prelude.Just + (ChangeType'Unrecognized + (ChangeType'UnrecognizedValue (Prelude.fromIntegral k))) + showEnum NONE = "NONE" + showEnum ADDED = "ADDED" + showEnum REMOVED = "REMOVED" + showEnum MODIFIED = "MODIFIED" + showEnum (ChangeType'Unrecognized (ChangeType'UnrecognizedValue k)) + = Prelude.show k + readEnum k + | (Prelude.==) k "NONE" = Prelude.Just NONE + | (Prelude.==) k "ADDED" = Prelude.Just ADDED + | (Prelude.==) k "REMOVED" = Prelude.Just REMOVED + | (Prelude.==) k "MODIFIED" = Prelude.Just MODIFIED + readEnum k + = (Prelude.>>=) (Text.Read.readMaybe k) Data.ProtoLens.maybeToEnum +instance Prelude.Bounded ChangeType where + minBound = NONE + maxBound = MODIFIED +instance Prelude.Enum ChangeType where + toEnum k__ + = Prelude.maybe + (Prelude.error + ((Prelude.++) "toEnum: unknown value for enum ChangeType: " + (Prelude.show k__))) + Prelude.id + (Data.ProtoLens.maybeToEnum k__) + fromEnum NONE = 0 + fromEnum ADDED = 1 + fromEnum REMOVED = 2 + fromEnum MODIFIED = 3 + fromEnum (ChangeType'Unrecognized (ChangeType'UnrecognizedValue k)) + = Prelude.fromIntegral k + succ MODIFIED + = Prelude.error + "ChangeType.succ: bad argument MODIFIED. This value would be out of bounds." + succ NONE = ADDED + succ ADDED = REMOVED + succ REMOVED = MODIFIED + succ (ChangeType'Unrecognized _) + = Prelude.error "ChangeType.succ: bad argument: unrecognized value" + pred NONE + = Prelude.error + "ChangeType.pred: bad argument NONE. This value would be out of bounds." + pred ADDED = NONE + pred REMOVED = ADDED + pred MODIFIED = REMOVED + pred (ChangeType'Unrecognized _) + = Prelude.error "ChangeType.pred: bad argument: unrecognized value" + enumFrom = Data.ProtoLens.Message.Enum.messageEnumFrom + enumFromTo = Data.ProtoLens.Message.Enum.messageEnumFromTo + enumFromThen = Data.ProtoLens.Message.Enum.messageEnumFromThen + enumFromThenTo = Data.ProtoLens.Message.Enum.messageEnumFromThenTo +instance Data.ProtoLens.FieldDefault ChangeType where + fieldDefault = NONE +instance Control.DeepSeq.NFData ChangeType where + rnf x__ = Prelude.seq x__ (()) +{- | Fields : + + * 'Proto.Semantic_Fields.term' @:: Lens' DeletedTerm Data.Text.Text@ + * 'Proto.Semantic_Fields.span' @:: Lens' DeletedTerm Span@ + * 'Proto.Semantic_Fields.maybe'span' @:: Lens' DeletedTerm (Prelude.Maybe Span)@ + -} +data DeletedTerm = DeletedTerm{_DeletedTerm'term :: + !Data.Text.Text, + _DeletedTerm'span :: !(Prelude.Maybe Span), + _DeletedTerm'_unknownFields :: !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show DeletedTerm where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' DeletedTerm "term" (Data.Text.Text) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _DeletedTerm'term + (\ x__ y__ -> x__{_DeletedTerm'term = y__})) + Prelude.id +instance Lens.Labels.HasLens' DeletedTerm "span" (Span) where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _DeletedTerm'span + (\ x__ y__ -> x__{_DeletedTerm'span = y__})) + (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) +instance Lens.Labels.HasLens' DeletedTerm "maybe'span" + (Prelude.Maybe Span) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _DeletedTerm'span + (\ x__ y__ -> x__{_DeletedTerm'span = y__})) + Prelude.id +instance Data.ProtoLens.Message DeletedTerm where + messageName _ = Data.Text.pack "github.semantic.DeletedTerm" + fieldsByTag + = let term__field_descriptor + = Data.ProtoLens.FieldDescriptor "term" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "term"))) + :: Data.ProtoLens.FieldDescriptor DeletedTerm + span__field_descriptor + = Data.ProtoLens.FieldDescriptor "span" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor Span) + (Data.ProtoLens.OptionalField + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'span"))) + :: Data.ProtoLens.FieldDescriptor DeletedTerm + in + Data.Map.fromList + [(Data.ProtoLens.Tag 1, term__field_descriptor), + (Data.ProtoLens.Tag 2, span__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _DeletedTerm'_unknownFields + (\ x__ y__ -> x__{_DeletedTerm'_unknownFields = y__}) + defMessage + = DeletedTerm{_DeletedTerm'term = Data.ProtoLens.fieldDefault, + _DeletedTerm'span = Prelude.Nothing, + _DeletedTerm'_unknownFields = ([])} +instance Control.DeepSeq.NFData DeletedTerm where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_DeletedTerm'_unknownFields x__) + (Control.DeepSeq.deepseq (_DeletedTerm'term x__) + (Control.DeepSeq.deepseq (_DeletedTerm'span x__) (()))) +{- | Fields : + + * 'Proto.Semantic_Fields.source' @:: Lens' DiffTreeEdge Data.Int.Int32@ + * 'Proto.Semantic_Fields.target' @:: Lens' DiffTreeEdge Data.Int.Int32@ + -} +data DiffTreeEdge = DiffTreeEdge{_DiffTreeEdge'source :: + !Data.Int.Int32, + _DiffTreeEdge'target :: !Data.Int.Int32, + _DiffTreeEdge'_unknownFields :: !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show DiffTreeEdge where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' DiffTreeEdge "source" + (Data.Int.Int32) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _DiffTreeEdge'source + (\ x__ y__ -> x__{_DiffTreeEdge'source = y__})) + Prelude.id +instance Lens.Labels.HasLens' DiffTreeEdge "target" + (Data.Int.Int32) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _DiffTreeEdge'target + (\ x__ y__ -> x__{_DiffTreeEdge'target = y__})) + Prelude.id +instance Data.ProtoLens.Message DiffTreeEdge where + messageName _ = Data.Text.pack "github.semantic.DiffTreeEdge" + fieldsByTag + = let source__field_descriptor + = Data.ProtoLens.FieldDescriptor "source" + (Data.ProtoLens.ScalarField Data.ProtoLens.Int32Field :: + Data.ProtoLens.FieldTypeDescriptor Data.Int.Int32) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "source"))) + :: Data.ProtoLens.FieldDescriptor DiffTreeEdge + target__field_descriptor + = Data.ProtoLens.FieldDescriptor "target" + (Data.ProtoLens.ScalarField Data.ProtoLens.Int32Field :: + Data.ProtoLens.FieldTypeDescriptor Data.Int.Int32) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "target"))) + :: Data.ProtoLens.FieldDescriptor DiffTreeEdge + in + Data.Map.fromList + [(Data.ProtoLens.Tag 1, source__field_descriptor), + (Data.ProtoLens.Tag 2, target__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _DiffTreeEdge'_unknownFields + (\ x__ y__ -> x__{_DiffTreeEdge'_unknownFields = y__}) + defMessage + = DiffTreeEdge{_DiffTreeEdge'source = Data.ProtoLens.fieldDefault, + _DiffTreeEdge'target = Data.ProtoLens.fieldDefault, + _DiffTreeEdge'_unknownFields = ([])} +instance Control.DeepSeq.NFData DiffTreeEdge where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_DiffTreeEdge'_unknownFields x__) + (Control.DeepSeq.deepseq (_DiffTreeEdge'source x__) + (Control.DeepSeq.deepseq (_DiffTreeEdge'target x__) (()))) +{- | Fields : + + * 'Proto.Semantic_Fields.path' @:: Lens' DiffTreeFileGraph Data.Text.Text@ + * 'Proto.Semantic_Fields.language' @:: Lens' DiffTreeFileGraph Data.Text.Text@ + * 'Proto.Semantic_Fields.vertices' @:: Lens' DiffTreeFileGraph [DiffTreeVertex]@ + * 'Proto.Semantic_Fields.edges' @:: Lens' DiffTreeFileGraph [DiffTreeEdge]@ + * 'Proto.Semantic_Fields.errors' @:: Lens' DiffTreeFileGraph [ParseError]@ + -} +data DiffTreeFileGraph = DiffTreeFileGraph{_DiffTreeFileGraph'path + :: !Data.Text.Text, + _DiffTreeFileGraph'language :: !Data.Text.Text, + _DiffTreeFileGraph'vertices :: ![DiffTreeVertex], + _DiffTreeFileGraph'edges :: ![DiffTreeEdge], + _DiffTreeFileGraph'errors :: ![ParseError], + _DiffTreeFileGraph'_unknownFields :: + !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show DiffTreeFileGraph where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' DiffTreeFileGraph "path" + (Data.Text.Text) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _DiffTreeFileGraph'path + (\ x__ y__ -> x__{_DiffTreeFileGraph'path = y__})) + Prelude.id +instance Lens.Labels.HasLens' DiffTreeFileGraph "language" + (Data.Text.Text) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _DiffTreeFileGraph'language + (\ x__ y__ -> x__{_DiffTreeFileGraph'language = y__})) + Prelude.id +instance Lens.Labels.HasLens' DiffTreeFileGraph "vertices" + ([DiffTreeVertex]) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _DiffTreeFileGraph'vertices + (\ x__ y__ -> x__{_DiffTreeFileGraph'vertices = y__})) + Prelude.id +instance Lens.Labels.HasLens' DiffTreeFileGraph "edges" + ([DiffTreeEdge]) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _DiffTreeFileGraph'edges + (\ x__ y__ -> x__{_DiffTreeFileGraph'edges = y__})) + Prelude.id +instance Lens.Labels.HasLens' DiffTreeFileGraph "errors" + ([ParseError]) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _DiffTreeFileGraph'errors + (\ x__ y__ -> x__{_DiffTreeFileGraph'errors = y__})) + Prelude.id +instance Data.ProtoLens.Message DiffTreeFileGraph where + messageName _ = Data.Text.pack "github.semantic.DiffTreeFileGraph" + fieldsByTag + = let path__field_descriptor + = Data.ProtoLens.FieldDescriptor "path" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "path"))) + :: Data.ProtoLens.FieldDescriptor DiffTreeFileGraph + language__field_descriptor + = Data.ProtoLens.FieldDescriptor "language" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "language"))) + :: Data.ProtoLens.FieldDescriptor DiffTreeFileGraph + vertices__field_descriptor + = Data.ProtoLens.FieldDescriptor "vertices" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor DiffTreeVertex) + (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "vertices"))) + :: Data.ProtoLens.FieldDescriptor DiffTreeFileGraph + edges__field_descriptor + = Data.ProtoLens.FieldDescriptor "edges" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor DiffTreeEdge) + (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "edges"))) + :: Data.ProtoLens.FieldDescriptor DiffTreeFileGraph + errors__field_descriptor + = Data.ProtoLens.FieldDescriptor "errors" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor ParseError) + (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "errors"))) + :: Data.ProtoLens.FieldDescriptor DiffTreeFileGraph + in + Data.Map.fromList + [(Data.ProtoLens.Tag 1, path__field_descriptor), + (Data.ProtoLens.Tag 2, language__field_descriptor), + (Data.ProtoLens.Tag 3, vertices__field_descriptor), + (Data.ProtoLens.Tag 4, edges__field_descriptor), + (Data.ProtoLens.Tag 5, errors__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _DiffTreeFileGraph'_unknownFields + (\ x__ y__ -> x__{_DiffTreeFileGraph'_unknownFields = y__}) + defMessage + = DiffTreeFileGraph{_DiffTreeFileGraph'path = + Data.ProtoLens.fieldDefault, + _DiffTreeFileGraph'language = Data.ProtoLens.fieldDefault, + _DiffTreeFileGraph'vertices = [], _DiffTreeFileGraph'edges = [], + _DiffTreeFileGraph'errors = [], + _DiffTreeFileGraph'_unknownFields = ([])} +instance Control.DeepSeq.NFData DiffTreeFileGraph where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_DiffTreeFileGraph'_unknownFields x__) + (Control.DeepSeq.deepseq (_DiffTreeFileGraph'path x__) + (Control.DeepSeq.deepseq (_DiffTreeFileGraph'language x__) + (Control.DeepSeq.deepseq (_DiffTreeFileGraph'vertices x__) + (Control.DeepSeq.deepseq (_DiffTreeFileGraph'edges x__) + (Control.DeepSeq.deepseq (_DiffTreeFileGraph'errors x__) (())))))) +{- | Fields : + + * 'Proto.Semantic_Fields.files' @:: Lens' DiffTreeGraphResponse [DiffTreeFileGraph]@ + -} +data DiffTreeGraphResponse = DiffTreeGraphResponse{_DiffTreeGraphResponse'files + :: ![DiffTreeFileGraph], + _DiffTreeGraphResponse'_unknownFields :: + !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show DiffTreeGraphResponse where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' DiffTreeGraphResponse "files" + ([DiffTreeFileGraph]) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _DiffTreeGraphResponse'files + (\ x__ y__ -> x__{_DiffTreeGraphResponse'files = y__})) + Prelude.id +instance Data.ProtoLens.Message DiffTreeGraphResponse where + messageName _ + = Data.Text.pack "github.semantic.DiffTreeGraphResponse" + fieldsByTag + = let files__field_descriptor + = Data.ProtoLens.FieldDescriptor "files" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor DiffTreeFileGraph) + (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "files"))) + :: Data.ProtoLens.FieldDescriptor DiffTreeGraphResponse + in + Data.Map.fromList [(Data.ProtoLens.Tag 1, files__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _DiffTreeGraphResponse'_unknownFields + (\ x__ y__ -> x__{_DiffTreeGraphResponse'_unknownFields = y__}) + defMessage + = DiffTreeGraphResponse{_DiffTreeGraphResponse'files = [], + _DiffTreeGraphResponse'_unknownFields = ([])} +instance Control.DeepSeq.NFData DiffTreeGraphResponse where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_DiffTreeGraphResponse'_unknownFields x__) + (Control.DeepSeq.deepseq (_DiffTreeGraphResponse'files x__) (())) +{- | Fields : + + * 'Proto.Semantic_Fields.blobs' @:: Lens' DiffTreeRequest [BlobPair]@ + -} +data DiffTreeRequest = DiffTreeRequest{_DiffTreeRequest'blobs :: + ![BlobPair], + _DiffTreeRequest'_unknownFields :: !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show DiffTreeRequest where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' DiffTreeRequest "blobs" ([BlobPair]) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _DiffTreeRequest'blobs + (\ x__ y__ -> x__{_DiffTreeRequest'blobs = y__})) + Prelude.id +instance Data.ProtoLens.Message DiffTreeRequest where + messageName _ = Data.Text.pack "github.semantic.DiffTreeRequest" + fieldsByTag + = let blobs__field_descriptor + = Data.ProtoLens.FieldDescriptor "blobs" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor BlobPair) + (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "blobs"))) + :: Data.ProtoLens.FieldDescriptor DiffTreeRequest + in + Data.Map.fromList [(Data.ProtoLens.Tag 1, blobs__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _DiffTreeRequest'_unknownFields + (\ x__ y__ -> x__{_DiffTreeRequest'_unknownFields = y__}) + defMessage + = DiffTreeRequest{_DiffTreeRequest'blobs = [], + _DiffTreeRequest'_unknownFields = ([])} +instance Control.DeepSeq.NFData DiffTreeRequest where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_DiffTreeRequest'_unknownFields x__) + (Control.DeepSeq.deepseq (_DiffTreeRequest'blobs x__) (())) +{- | Fields : + + * 'Proto.Semantic_Fields.files' @:: Lens' DiffTreeTOCResponse [TOCSummaryFile]@ + -} +data DiffTreeTOCResponse = DiffTreeTOCResponse{_DiffTreeTOCResponse'files + :: ![TOCSummaryFile], + _DiffTreeTOCResponse'_unknownFields :: + !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show DiffTreeTOCResponse where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' DiffTreeTOCResponse "files" + ([TOCSummaryFile]) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _DiffTreeTOCResponse'files + (\ x__ y__ -> x__{_DiffTreeTOCResponse'files = y__})) + Prelude.id +instance Data.ProtoLens.Message DiffTreeTOCResponse where + messageName _ + = Data.Text.pack "github.semantic.DiffTreeTOCResponse" + fieldsByTag + = let files__field_descriptor + = Data.ProtoLens.FieldDescriptor "files" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor TOCSummaryFile) + (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "files"))) + :: Data.ProtoLens.FieldDescriptor DiffTreeTOCResponse + in + Data.Map.fromList [(Data.ProtoLens.Tag 1, files__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _DiffTreeTOCResponse'_unknownFields + (\ x__ y__ -> x__{_DiffTreeTOCResponse'_unknownFields = y__}) + defMessage + = DiffTreeTOCResponse{_DiffTreeTOCResponse'files = [], + _DiffTreeTOCResponse'_unknownFields = ([])} +instance Control.DeepSeq.NFData DiffTreeTOCResponse where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_DiffTreeTOCResponse'_unknownFields x__) + (Control.DeepSeq.deepseq (_DiffTreeTOCResponse'files x__) (())) +{- | Fields : + + * 'Proto.Semantic_Fields.diffVertexId' @:: Lens' DiffTreeVertex Data.Int.Int32@ + * 'Proto.Semantic_Fields.maybe'diffTerm' @:: Lens' DiffTreeVertex (Prelude.Maybe DiffTreeVertex'DiffTerm)@ + * 'Proto.Semantic_Fields.maybe'deleted' @:: Lens' DiffTreeVertex (Prelude.Maybe DeletedTerm)@ + * 'Proto.Semantic_Fields.deleted' @:: Lens' DiffTreeVertex DeletedTerm@ + * 'Proto.Semantic_Fields.maybe'inserted' @:: Lens' DiffTreeVertex (Prelude.Maybe InsertedTerm)@ + * 'Proto.Semantic_Fields.inserted' @:: Lens' DiffTreeVertex InsertedTerm@ + * 'Proto.Semantic_Fields.maybe'replaced' @:: Lens' DiffTreeVertex (Prelude.Maybe ReplacedTerm)@ + * 'Proto.Semantic_Fields.replaced' @:: Lens' DiffTreeVertex ReplacedTerm@ + * 'Proto.Semantic_Fields.maybe'merged' @:: Lens' DiffTreeVertex (Prelude.Maybe MergedTerm)@ + * 'Proto.Semantic_Fields.merged' @:: Lens' DiffTreeVertex MergedTerm@ + -} +data DiffTreeVertex = DiffTreeVertex{_DiffTreeVertex'diffVertexId + :: !Data.Int.Int32, + _DiffTreeVertex'diffTerm :: + !(Prelude.Maybe DiffTreeVertex'DiffTerm), + _DiffTreeVertex'_unknownFields :: !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show DiffTreeVertex where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +data DiffTreeVertex'DiffTerm = DiffTreeVertex'Deleted !DeletedTerm + | DiffTreeVertex'Inserted !InsertedTerm + | DiffTreeVertex'Replaced !ReplacedTerm + | DiffTreeVertex'Merged !MergedTerm + deriving (Prelude.Show, Prelude.Eq, Prelude.Ord) +instance Lens.Labels.HasLens' DiffTreeVertex "diffVertexId" + (Data.Int.Int32) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffVertexId + (\ x__ y__ -> x__{_DiffTreeVertex'diffVertexId = y__})) + Prelude.id +instance Lens.Labels.HasLens' DiffTreeVertex "maybe'diffTerm" + (Prelude.Maybe DiffTreeVertex'DiffTerm) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm + (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) + Prelude.id +instance Lens.Labels.HasLens' DiffTreeVertex "maybe'deleted" + (Prelude.Maybe DeletedTerm) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm + (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) + (Lens.Family2.Unchecked.lens + (\ x__ -> + case x__ of + Prelude.Just (DiffTreeVertex'Deleted x__val) -> Prelude.Just x__val + _otherwise -> Prelude.Nothing) + (\ _ y__ -> Prelude.fmap DiffTreeVertex'Deleted y__)) +instance Lens.Labels.HasLens' DiffTreeVertex "deleted" + (DeletedTerm) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm + (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) + ((Prelude..) + (Lens.Family2.Unchecked.lens + (\ x__ -> + case x__ of + Prelude.Just (DiffTreeVertex'Deleted x__val) -> Prelude.Just x__val + _otherwise -> Prelude.Nothing) + (\ _ y__ -> Prelude.fmap DiffTreeVertex'Deleted y__)) + (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage)) +instance Lens.Labels.HasLens' DiffTreeVertex "maybe'inserted" + (Prelude.Maybe InsertedTerm) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm + (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) + (Lens.Family2.Unchecked.lens + (\ x__ -> + case x__ of + Prelude.Just (DiffTreeVertex'Inserted x__val) -> Prelude.Just + x__val + _otherwise -> Prelude.Nothing) + (\ _ y__ -> Prelude.fmap DiffTreeVertex'Inserted y__)) +instance Lens.Labels.HasLens' DiffTreeVertex "inserted" + (InsertedTerm) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm + (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) + ((Prelude..) + (Lens.Family2.Unchecked.lens + (\ x__ -> + case x__ of + Prelude.Just (DiffTreeVertex'Inserted x__val) -> Prelude.Just + x__val + _otherwise -> Prelude.Nothing) + (\ _ y__ -> Prelude.fmap DiffTreeVertex'Inserted y__)) + (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage)) +instance Lens.Labels.HasLens' DiffTreeVertex "maybe'replaced" + (Prelude.Maybe ReplacedTerm) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm + (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) + (Lens.Family2.Unchecked.lens + (\ x__ -> + case x__ of + Prelude.Just (DiffTreeVertex'Replaced x__val) -> Prelude.Just + x__val + _otherwise -> Prelude.Nothing) + (\ _ y__ -> Prelude.fmap DiffTreeVertex'Replaced y__)) +instance Lens.Labels.HasLens' DiffTreeVertex "replaced" + (ReplacedTerm) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm + (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) + ((Prelude..) + (Lens.Family2.Unchecked.lens + (\ x__ -> + case x__ of + Prelude.Just (DiffTreeVertex'Replaced x__val) -> Prelude.Just + x__val + _otherwise -> Prelude.Nothing) + (\ _ y__ -> Prelude.fmap DiffTreeVertex'Replaced y__)) + (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage)) +instance Lens.Labels.HasLens' DiffTreeVertex "maybe'merged" + (Prelude.Maybe MergedTerm) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm + (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) + (Lens.Family2.Unchecked.lens + (\ x__ -> + case x__ of + Prelude.Just (DiffTreeVertex'Merged x__val) -> Prelude.Just x__val + _otherwise -> Prelude.Nothing) + (\ _ y__ -> Prelude.fmap DiffTreeVertex'Merged y__)) +instance Lens.Labels.HasLens' DiffTreeVertex "merged" (MergedTerm) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm + (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) + ((Prelude..) + (Lens.Family2.Unchecked.lens + (\ x__ -> + case x__ of + Prelude.Just (DiffTreeVertex'Merged x__val) -> Prelude.Just x__val + _otherwise -> Prelude.Nothing) + (\ _ y__ -> Prelude.fmap DiffTreeVertex'Merged y__)) + (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage)) +instance Data.ProtoLens.Message DiffTreeVertex where + messageName _ = Data.Text.pack "github.semantic.DiffTreeVertex" + fieldsByTag + = let diffVertexId__field_descriptor + = Data.ProtoLens.FieldDescriptor "diff_vertex_id" + (Data.ProtoLens.ScalarField Data.ProtoLens.Int32Field :: + Data.ProtoLens.FieldTypeDescriptor Data.Int.Int32) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "diffVertexId"))) + :: Data.ProtoLens.FieldDescriptor DiffTreeVertex + deleted__field_descriptor + = Data.ProtoLens.FieldDescriptor "deleted" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor DeletedTerm) + (Data.ProtoLens.OptionalField + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'deleted"))) + :: Data.ProtoLens.FieldDescriptor DiffTreeVertex + inserted__field_descriptor + = Data.ProtoLens.FieldDescriptor "inserted" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor InsertedTerm) + (Data.ProtoLens.OptionalField + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'inserted"))) + :: Data.ProtoLens.FieldDescriptor DiffTreeVertex + replaced__field_descriptor + = Data.ProtoLens.FieldDescriptor "replaced" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor ReplacedTerm) + (Data.ProtoLens.OptionalField + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'replaced"))) + :: Data.ProtoLens.FieldDescriptor DiffTreeVertex + merged__field_descriptor + = Data.ProtoLens.FieldDescriptor "merged" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor MergedTerm) + (Data.ProtoLens.OptionalField + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'merged"))) + :: Data.ProtoLens.FieldDescriptor DiffTreeVertex + in + Data.Map.fromList + [(Data.ProtoLens.Tag 1, diffVertexId__field_descriptor), + (Data.ProtoLens.Tag 2, deleted__field_descriptor), + (Data.ProtoLens.Tag 3, inserted__field_descriptor), + (Data.ProtoLens.Tag 4, replaced__field_descriptor), + (Data.ProtoLens.Tag 5, merged__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _DiffTreeVertex'_unknownFields + (\ x__ y__ -> x__{_DiffTreeVertex'_unknownFields = y__}) + defMessage + = DiffTreeVertex{_DiffTreeVertex'diffVertexId = + Data.ProtoLens.fieldDefault, + _DiffTreeVertex'diffTerm = Prelude.Nothing, + _DiffTreeVertex'_unknownFields = ([])} +instance Control.DeepSeq.NFData DiffTreeVertex where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_DiffTreeVertex'_unknownFields x__) + (Control.DeepSeq.deepseq (_DiffTreeVertex'diffVertexId x__) + (Control.DeepSeq.deepseq (_DiffTreeVertex'diffTerm x__) (()))) +instance Control.DeepSeq.NFData DiffTreeVertex'DiffTerm where + rnf (DiffTreeVertex'Deleted x__) = Control.DeepSeq.rnf x__ + rnf (DiffTreeVertex'Inserted x__) = Control.DeepSeq.rnf x__ + rnf (DiffTreeVertex'Replaced x__) = Control.DeepSeq.rnf x__ + rnf (DiffTreeVertex'Merged x__) = Control.DeepSeq.rnf x__ +_DiffTreeVertex'Deleted :: + Lens.Labels.Prism.Prism' DiffTreeVertex'DiffTerm DeletedTerm +_DiffTreeVertex'Deleted + = Lens.Labels.Prism.prism' DiffTreeVertex'Deleted + (\ p__ -> + case p__ of + DiffTreeVertex'Deleted p__val -> Prelude.Just p__val + _otherwise -> Prelude.Nothing) +_DiffTreeVertex'Inserted :: + Lens.Labels.Prism.Prism' DiffTreeVertex'DiffTerm InsertedTerm +_DiffTreeVertex'Inserted + = Lens.Labels.Prism.prism' DiffTreeVertex'Inserted + (\ p__ -> + case p__ of + DiffTreeVertex'Inserted p__val -> Prelude.Just p__val + _otherwise -> Prelude.Nothing) +_DiffTreeVertex'Replaced :: + Lens.Labels.Prism.Prism' DiffTreeVertex'DiffTerm ReplacedTerm +_DiffTreeVertex'Replaced + = Lens.Labels.Prism.prism' DiffTreeVertex'Replaced + (\ p__ -> + case p__ of + DiffTreeVertex'Replaced p__val -> Prelude.Just p__val + _otherwise -> Prelude.Nothing) +_DiffTreeVertex'Merged :: + Lens.Labels.Prism.Prism' DiffTreeVertex'DiffTerm MergedTerm +_DiffTreeVertex'Merged + = Lens.Labels.Prism.prism' DiffTreeVertex'Merged + (\ p__ -> + case p__ of + DiffTreeVertex'Merged p__val -> Prelude.Just p__val + _otherwise -> Prelude.Nothing) +{- | Fields : + + * 'Proto.Semantic_Fields.docstring' @:: Lens' Docstring Data.Text.Text@ + -} +data Docstring = Docstring{_Docstring'docstring :: !Data.Text.Text, + _Docstring'_unknownFields :: !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show Docstring where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' Docstring "docstring" + (Data.Text.Text) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _Docstring'docstring + (\ x__ y__ -> x__{_Docstring'docstring = y__})) + Prelude.id +instance Data.ProtoLens.Message Docstring where + messageName _ = Data.Text.pack "github.semantic.Docstring" + fieldsByTag + = let docstring__field_descriptor + = Data.ProtoLens.FieldDescriptor "docstring" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "docstring"))) + :: Data.ProtoLens.FieldDescriptor Docstring + in + Data.Map.fromList + [(Data.ProtoLens.Tag 1, docstring__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _Docstring'_unknownFields + (\ x__ y__ -> x__{_Docstring'_unknownFields = y__}) + defMessage + = Docstring{_Docstring'docstring = Data.ProtoLens.fieldDefault, + _Docstring'_unknownFields = ([])} +instance Control.DeepSeq.NFData Docstring where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_Docstring'_unknownFields x__) + (Control.DeepSeq.deepseq (_Docstring'docstring x__) (())) +{- | Fields : + + * 'Proto.Semantic_Fields.path' @:: Lens' File Data.Text.Text@ + * 'Proto.Semantic_Fields.language' @:: Lens' File Data.Text.Text@ + * 'Proto.Semantic_Fields.symbols' @:: Lens' File [Symbol]@ + * 'Proto.Semantic_Fields.errors' @:: Lens' File [ParseError]@ + * 'Proto.Semantic_Fields.blobOid' @:: Lens' File Data.Text.Text@ + -} +data File = File{_File'path :: !Data.Text.Text, + _File'language :: !Data.Text.Text, _File'symbols :: ![Symbol], + _File'errors :: ![ParseError], _File'blobOid :: !Data.Text.Text, + _File'_unknownFields :: !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show File where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' File "path" (Data.Text.Text) where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _File'path + (\ x__ y__ -> x__{_File'path = y__})) + Prelude.id +instance Lens.Labels.HasLens' File "language" (Data.Text.Text) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _File'language + (\ x__ y__ -> x__{_File'language = y__})) + Prelude.id +instance Lens.Labels.HasLens' File "symbols" ([Symbol]) where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _File'symbols + (\ x__ y__ -> x__{_File'symbols = y__})) + Prelude.id +instance Lens.Labels.HasLens' File "errors" ([ParseError]) where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _File'errors + (\ x__ y__ -> x__{_File'errors = y__})) + Prelude.id +instance Lens.Labels.HasLens' File "blobOid" (Data.Text.Text) where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _File'blobOid + (\ x__ y__ -> x__{_File'blobOid = y__})) + Prelude.id +instance Data.ProtoLens.Message File where + messageName _ = Data.Text.pack "github.semantic.File" + fieldsByTag + = let path__field_descriptor + = Data.ProtoLens.FieldDescriptor "path" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "path"))) + :: Data.ProtoLens.FieldDescriptor File + language__field_descriptor + = Data.ProtoLens.FieldDescriptor "language" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "language"))) + :: Data.ProtoLens.FieldDescriptor File + symbols__field_descriptor + = Data.ProtoLens.FieldDescriptor "symbols" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor Symbol) + (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "symbols"))) + :: Data.ProtoLens.FieldDescriptor File + errors__field_descriptor + = Data.ProtoLens.FieldDescriptor "errors" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor ParseError) + (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "errors"))) + :: Data.ProtoLens.FieldDescriptor File + blobOid__field_descriptor + = Data.ProtoLens.FieldDescriptor "blob_oid" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "blobOid"))) + :: Data.ProtoLens.FieldDescriptor File + in + Data.Map.fromList + [(Data.ProtoLens.Tag 1, path__field_descriptor), + (Data.ProtoLens.Tag 2, language__field_descriptor), + (Data.ProtoLens.Tag 3, symbols__field_descriptor), + (Data.ProtoLens.Tag 4, errors__field_descriptor), + (Data.ProtoLens.Tag 5, blobOid__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _File'_unknownFields + (\ x__ y__ -> x__{_File'_unknownFields = y__}) + defMessage + = File{_File'path = Data.ProtoLens.fieldDefault, + _File'language = Data.ProtoLens.fieldDefault, _File'symbols = [], + _File'errors = [], _File'blobOid = Data.ProtoLens.fieldDefault, + _File'_unknownFields = ([])} +instance Control.DeepSeq.NFData File where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_File'_unknownFields x__) + (Control.DeepSeq.deepseq (_File'path x__) + (Control.DeepSeq.deepseq (_File'language x__) + (Control.DeepSeq.deepseq (_File'symbols x__) + (Control.DeepSeq.deepseq (_File'errors x__) + (Control.DeepSeq.deepseq (_File'blobOid x__) (())))))) +{- | Fields : + + * 'Proto.Semantic_Fields.term' @:: Lens' InsertedTerm Data.Text.Text@ + * 'Proto.Semantic_Fields.span' @:: Lens' InsertedTerm Span@ + * 'Proto.Semantic_Fields.maybe'span' @:: Lens' InsertedTerm (Prelude.Maybe Span)@ + -} +data InsertedTerm = InsertedTerm{_InsertedTerm'term :: + !Data.Text.Text, + _InsertedTerm'span :: !(Prelude.Maybe Span), + _InsertedTerm'_unknownFields :: !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show InsertedTerm where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' InsertedTerm "term" (Data.Text.Text) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _InsertedTerm'term + (\ x__ y__ -> x__{_InsertedTerm'term = y__})) + Prelude.id +instance Lens.Labels.HasLens' InsertedTerm "span" (Span) where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _InsertedTerm'span + (\ x__ y__ -> x__{_InsertedTerm'span = y__})) + (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) +instance Lens.Labels.HasLens' InsertedTerm "maybe'span" + (Prelude.Maybe Span) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _InsertedTerm'span + (\ x__ y__ -> x__{_InsertedTerm'span = y__})) + Prelude.id +instance Data.ProtoLens.Message InsertedTerm where + messageName _ = Data.Text.pack "github.semantic.InsertedTerm" + fieldsByTag + = let term__field_descriptor + = Data.ProtoLens.FieldDescriptor "term" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "term"))) + :: Data.ProtoLens.FieldDescriptor InsertedTerm + span__field_descriptor + = Data.ProtoLens.FieldDescriptor "span" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor Span) + (Data.ProtoLens.OptionalField + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'span"))) + :: Data.ProtoLens.FieldDescriptor InsertedTerm + in + Data.Map.fromList + [(Data.ProtoLens.Tag 1, term__field_descriptor), + (Data.ProtoLens.Tag 2, span__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _InsertedTerm'_unknownFields + (\ x__ y__ -> x__{_InsertedTerm'_unknownFields = y__}) + defMessage + = InsertedTerm{_InsertedTerm'term = Data.ProtoLens.fieldDefault, + _InsertedTerm'span = Prelude.Nothing, + _InsertedTerm'_unknownFields = ([])} +instance Control.DeepSeq.NFData InsertedTerm where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_InsertedTerm'_unknownFields x__) + (Control.DeepSeq.deepseq (_InsertedTerm'term x__) + (Control.DeepSeq.deepseq (_InsertedTerm'span x__) (()))) +{- | Fields : + + * 'Proto.Semantic_Fields.term' @:: Lens' MergedTerm Data.Text.Text@ + * 'Proto.Semantic_Fields.beforeSpan' @:: Lens' MergedTerm Span@ + * 'Proto.Semantic_Fields.maybe'beforeSpan' @:: Lens' MergedTerm (Prelude.Maybe Span)@ + * 'Proto.Semantic_Fields.afterSpan' @:: Lens' MergedTerm Span@ + * 'Proto.Semantic_Fields.maybe'afterSpan' @:: Lens' MergedTerm (Prelude.Maybe Span)@ + -} +data MergedTerm = MergedTerm{_MergedTerm'term :: !Data.Text.Text, + _MergedTerm'beforeSpan :: !(Prelude.Maybe Span), + _MergedTerm'afterSpan :: !(Prelude.Maybe Span), + _MergedTerm'_unknownFields :: !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show MergedTerm where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' MergedTerm "term" (Data.Text.Text) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _MergedTerm'term + (\ x__ y__ -> x__{_MergedTerm'term = y__})) + Prelude.id +instance Lens.Labels.HasLens' MergedTerm "beforeSpan" (Span) where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _MergedTerm'beforeSpan + (\ x__ y__ -> x__{_MergedTerm'beforeSpan = y__})) + (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) +instance Lens.Labels.HasLens' MergedTerm "maybe'beforeSpan" + (Prelude.Maybe Span) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _MergedTerm'beforeSpan + (\ x__ y__ -> x__{_MergedTerm'beforeSpan = y__})) + Prelude.id +instance Lens.Labels.HasLens' MergedTerm "afterSpan" (Span) where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _MergedTerm'afterSpan + (\ x__ y__ -> x__{_MergedTerm'afterSpan = y__})) + (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) +instance Lens.Labels.HasLens' MergedTerm "maybe'afterSpan" + (Prelude.Maybe Span) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _MergedTerm'afterSpan + (\ x__ y__ -> x__{_MergedTerm'afterSpan = y__})) + Prelude.id +instance Data.ProtoLens.Message MergedTerm where + messageName _ = Data.Text.pack "github.semantic.MergedTerm" + fieldsByTag + = let term__field_descriptor + = Data.ProtoLens.FieldDescriptor "term" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "term"))) + :: Data.ProtoLens.FieldDescriptor MergedTerm + beforeSpan__field_descriptor + = Data.ProtoLens.FieldDescriptor "before_span" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor Span) + (Data.ProtoLens.OptionalField + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'beforeSpan"))) + :: Data.ProtoLens.FieldDescriptor MergedTerm + afterSpan__field_descriptor + = Data.ProtoLens.FieldDescriptor "after_span" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor Span) + (Data.ProtoLens.OptionalField + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'afterSpan"))) + :: Data.ProtoLens.FieldDescriptor MergedTerm + in + Data.Map.fromList + [(Data.ProtoLens.Tag 1, term__field_descriptor), + (Data.ProtoLens.Tag 2, beforeSpan__field_descriptor), + (Data.ProtoLens.Tag 3, afterSpan__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _MergedTerm'_unknownFields + (\ x__ y__ -> x__{_MergedTerm'_unknownFields = y__}) + defMessage + = MergedTerm{_MergedTerm'term = Data.ProtoLens.fieldDefault, + _MergedTerm'beforeSpan = Prelude.Nothing, + _MergedTerm'afterSpan = Prelude.Nothing, + _MergedTerm'_unknownFields = ([])} +instance Control.DeepSeq.NFData MergedTerm where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_MergedTerm'_unknownFields x__) + (Control.DeepSeq.deepseq (_MergedTerm'term x__) + (Control.DeepSeq.deepseq (_MergedTerm'beforeSpan x__) + (Control.DeepSeq.deepseq (_MergedTerm'afterSpan x__) (())))) +{- | Fields : + + * 'Proto.Semantic_Fields.error' @:: Lens' ParseError Data.Text.Text@ + -} +data ParseError = ParseError{_ParseError'error :: !Data.Text.Text, + _ParseError'_unknownFields :: !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show ParseError where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' ParseError "error" (Data.Text.Text) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _ParseError'error + (\ x__ y__ -> x__{_ParseError'error = y__})) + Prelude.id +instance Data.ProtoLens.Message ParseError where + messageName _ = Data.Text.pack "github.semantic.ParseError" + fieldsByTag + = let error__field_descriptor + = Data.ProtoLens.FieldDescriptor "error" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "error"))) + :: Data.ProtoLens.FieldDescriptor ParseError + in + Data.Map.fromList [(Data.ProtoLens.Tag 1, error__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _ParseError'_unknownFields + (\ x__ y__ -> x__{_ParseError'_unknownFields = y__}) + defMessage + = ParseError{_ParseError'error = Data.ProtoLens.fieldDefault, + _ParseError'_unknownFields = ([])} +instance Control.DeepSeq.NFData ParseError where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_ParseError'_unknownFields x__) + (Control.DeepSeq.deepseq (_ParseError'error x__) (())) +{- | Fields : + + * 'Proto.Semantic_Fields.path' @:: Lens' ParseTreeFileGraph Data.Text.Text@ + * 'Proto.Semantic_Fields.language' @:: Lens' ParseTreeFileGraph Data.Text.Text@ + * 'Proto.Semantic_Fields.vertices' @:: Lens' ParseTreeFileGraph [TermVertex]@ + * 'Proto.Semantic_Fields.edges' @:: Lens' ParseTreeFileGraph [TermEdge]@ + * 'Proto.Semantic_Fields.errors' @:: Lens' ParseTreeFileGraph [ParseError]@ + -} +data ParseTreeFileGraph = ParseTreeFileGraph{_ParseTreeFileGraph'path + :: !Data.Text.Text, + _ParseTreeFileGraph'language :: !Data.Text.Text, + _ParseTreeFileGraph'vertices :: ![TermVertex], + _ParseTreeFileGraph'edges :: ![TermEdge], + _ParseTreeFileGraph'errors :: ![ParseError], + _ParseTreeFileGraph'_unknownFields :: + !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show ParseTreeFileGraph where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' ParseTreeFileGraph "path" + (Data.Text.Text) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _ParseTreeFileGraph'path + (\ x__ y__ -> x__{_ParseTreeFileGraph'path = y__})) + Prelude.id +instance Lens.Labels.HasLens' ParseTreeFileGraph "language" + (Data.Text.Text) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _ParseTreeFileGraph'language + (\ x__ y__ -> x__{_ParseTreeFileGraph'language = y__})) + Prelude.id +instance Lens.Labels.HasLens' ParseTreeFileGraph "vertices" + ([TermVertex]) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _ParseTreeFileGraph'vertices + (\ x__ y__ -> x__{_ParseTreeFileGraph'vertices = y__})) + Prelude.id +instance Lens.Labels.HasLens' ParseTreeFileGraph "edges" + ([TermEdge]) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _ParseTreeFileGraph'edges + (\ x__ y__ -> x__{_ParseTreeFileGraph'edges = y__})) + Prelude.id +instance Lens.Labels.HasLens' ParseTreeFileGraph "errors" + ([ParseError]) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _ParseTreeFileGraph'errors + (\ x__ y__ -> x__{_ParseTreeFileGraph'errors = y__})) + Prelude.id +instance Data.ProtoLens.Message ParseTreeFileGraph where + messageName _ = Data.Text.pack "github.semantic.ParseTreeFileGraph" + fieldsByTag + = let path__field_descriptor + = Data.ProtoLens.FieldDescriptor "path" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "path"))) + :: Data.ProtoLens.FieldDescriptor ParseTreeFileGraph + language__field_descriptor + = Data.ProtoLens.FieldDescriptor "language" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "language"))) + :: Data.ProtoLens.FieldDescriptor ParseTreeFileGraph + vertices__field_descriptor + = Data.ProtoLens.FieldDescriptor "vertices" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor TermVertex) + (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "vertices"))) + :: Data.ProtoLens.FieldDescriptor ParseTreeFileGraph + edges__field_descriptor + = Data.ProtoLens.FieldDescriptor "edges" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor TermEdge) + (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "edges"))) + :: Data.ProtoLens.FieldDescriptor ParseTreeFileGraph + errors__field_descriptor + = Data.ProtoLens.FieldDescriptor "errors" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor ParseError) + (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "errors"))) + :: Data.ProtoLens.FieldDescriptor ParseTreeFileGraph + in + Data.Map.fromList + [(Data.ProtoLens.Tag 1, path__field_descriptor), + (Data.ProtoLens.Tag 2, language__field_descriptor), + (Data.ProtoLens.Tag 3, vertices__field_descriptor), + (Data.ProtoLens.Tag 4, edges__field_descriptor), + (Data.ProtoLens.Tag 5, errors__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _ParseTreeFileGraph'_unknownFields + (\ x__ y__ -> x__{_ParseTreeFileGraph'_unknownFields = y__}) + defMessage + = ParseTreeFileGraph{_ParseTreeFileGraph'path = + Data.ProtoLens.fieldDefault, + _ParseTreeFileGraph'language = Data.ProtoLens.fieldDefault, + _ParseTreeFileGraph'vertices = [], _ParseTreeFileGraph'edges = [], + _ParseTreeFileGraph'errors = [], + _ParseTreeFileGraph'_unknownFields = ([])} +instance Control.DeepSeq.NFData ParseTreeFileGraph where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_ParseTreeFileGraph'_unknownFields x__) + (Control.DeepSeq.deepseq (_ParseTreeFileGraph'path x__) + (Control.DeepSeq.deepseq (_ParseTreeFileGraph'language x__) + (Control.DeepSeq.deepseq (_ParseTreeFileGraph'vertices x__) + (Control.DeepSeq.deepseq (_ParseTreeFileGraph'edges x__) + (Control.DeepSeq.deepseq (_ParseTreeFileGraph'errors x__) (())))))) +{- | Fields : + + * 'Proto.Semantic_Fields.files' @:: Lens' ParseTreeGraphResponse [ParseTreeFileGraph]@ + -} +data ParseTreeGraphResponse = ParseTreeGraphResponse{_ParseTreeGraphResponse'files + :: ![ParseTreeFileGraph], + _ParseTreeGraphResponse'_unknownFields :: + !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show ParseTreeGraphResponse where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' ParseTreeGraphResponse "files" + ([ParseTreeFileGraph]) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _ParseTreeGraphResponse'files + (\ x__ y__ -> x__{_ParseTreeGraphResponse'files = y__})) + Prelude.id +instance Data.ProtoLens.Message ParseTreeGraphResponse where + messageName _ + = Data.Text.pack "github.semantic.ParseTreeGraphResponse" + fieldsByTag + = let files__field_descriptor + = Data.ProtoLens.FieldDescriptor "files" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor ParseTreeFileGraph) + (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "files"))) + :: Data.ProtoLens.FieldDescriptor ParseTreeGraphResponse + in + Data.Map.fromList [(Data.ProtoLens.Tag 1, files__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens + _ParseTreeGraphResponse'_unknownFields + (\ x__ y__ -> x__{_ParseTreeGraphResponse'_unknownFields = y__}) + defMessage + = ParseTreeGraphResponse{_ParseTreeGraphResponse'files = [], + _ParseTreeGraphResponse'_unknownFields = ([])} +instance Control.DeepSeq.NFData ParseTreeGraphResponse where + rnf + = \ x__ -> + Control.DeepSeq.deepseq + (_ParseTreeGraphResponse'_unknownFields x__) + (Control.DeepSeq.deepseq (_ParseTreeGraphResponse'files x__) (())) +{- | Fields : + + * 'Proto.Semantic_Fields.blobs' @:: Lens' ParseTreeRequest [Blob]@ + -} +data ParseTreeRequest = ParseTreeRequest{_ParseTreeRequest'blobs :: + ![Blob], + _ParseTreeRequest'_unknownFields :: + !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show ParseTreeRequest where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' ParseTreeRequest "blobs" ([Blob]) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _ParseTreeRequest'blobs + (\ x__ y__ -> x__{_ParseTreeRequest'blobs = y__})) + Prelude.id +instance Data.ProtoLens.Message ParseTreeRequest where + messageName _ = Data.Text.pack "github.semantic.ParseTreeRequest" + fieldsByTag + = let blobs__field_descriptor + = Data.ProtoLens.FieldDescriptor "blobs" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor Blob) + (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "blobs"))) + :: Data.ProtoLens.FieldDescriptor ParseTreeRequest + in + Data.Map.fromList [(Data.ProtoLens.Tag 1, blobs__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _ParseTreeRequest'_unknownFields + (\ x__ y__ -> x__{_ParseTreeRequest'_unknownFields = y__}) + defMessage + = ParseTreeRequest{_ParseTreeRequest'blobs = [], + _ParseTreeRequest'_unknownFields = ([])} +instance Control.DeepSeq.NFData ParseTreeRequest where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_ParseTreeRequest'_unknownFields x__) + (Control.DeepSeq.deepseq (_ParseTreeRequest'blobs x__) (())) +{- | Fields : + + * 'Proto.Semantic_Fields.files' @:: Lens' ParseTreeSymbolResponse [File]@ + -} +data ParseTreeSymbolResponse = ParseTreeSymbolResponse{_ParseTreeSymbolResponse'files + :: ![File], + _ParseTreeSymbolResponse'_unknownFields :: + !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show ParseTreeSymbolResponse where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' ParseTreeSymbolResponse "files" + ([File]) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _ParseTreeSymbolResponse'files + (\ x__ y__ -> x__{_ParseTreeSymbolResponse'files = y__})) + Prelude.id +instance Data.ProtoLens.Message ParseTreeSymbolResponse where + messageName _ + = Data.Text.pack "github.semantic.ParseTreeSymbolResponse" + fieldsByTag + = let files__field_descriptor + = Data.ProtoLens.FieldDescriptor "files" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor File) + (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "files"))) + :: Data.ProtoLens.FieldDescriptor ParseTreeSymbolResponse + in + Data.Map.fromList [(Data.ProtoLens.Tag 1, files__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens + _ParseTreeSymbolResponse'_unknownFields + (\ x__ y__ -> x__{_ParseTreeSymbolResponse'_unknownFields = y__}) + defMessage + = ParseTreeSymbolResponse{_ParseTreeSymbolResponse'files = [], + _ParseTreeSymbolResponse'_unknownFields = ([])} +instance Control.DeepSeq.NFData ParseTreeSymbolResponse where + rnf + = \ x__ -> + Control.DeepSeq.deepseq + (_ParseTreeSymbolResponse'_unknownFields x__) + (Control.DeepSeq.deepseq (_ParseTreeSymbolResponse'files x__) (())) +{- | Fields : + + * 'Proto.Semantic_Fields.service' @:: Lens' PingRequest Data.Text.Text@ + -} +data PingRequest = PingRequest{_PingRequest'service :: + !Data.Text.Text, + _PingRequest'_unknownFields :: !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show PingRequest where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' PingRequest "service" + (Data.Text.Text) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _PingRequest'service + (\ x__ y__ -> x__{_PingRequest'service = y__})) + Prelude.id +instance Data.ProtoLens.Message PingRequest where + messageName _ = Data.Text.pack "github.semantic.PingRequest" + fieldsByTag + = let service__field_descriptor + = Data.ProtoLens.FieldDescriptor "service" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "service"))) + :: Data.ProtoLens.FieldDescriptor PingRequest + in + Data.Map.fromList + [(Data.ProtoLens.Tag 1, service__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _PingRequest'_unknownFields + (\ x__ y__ -> x__{_PingRequest'_unknownFields = y__}) + defMessage + = PingRequest{_PingRequest'service = Data.ProtoLens.fieldDefault, + _PingRequest'_unknownFields = ([])} +instance Control.DeepSeq.NFData PingRequest where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_PingRequest'_unknownFields x__) + (Control.DeepSeq.deepseq (_PingRequest'service x__) (())) +{- | Fields : + + * 'Proto.Semantic_Fields.status' @:: Lens' PingResponse Data.Text.Text@ + * 'Proto.Semantic_Fields.hostname' @:: Lens' PingResponse Data.Text.Text@ + * 'Proto.Semantic_Fields.timestamp' @:: Lens' PingResponse Data.Text.Text@ + * 'Proto.Semantic_Fields.sha' @:: Lens' PingResponse Data.Text.Text@ + -} +data PingResponse = PingResponse{_PingResponse'status :: + !Data.Text.Text, + _PingResponse'hostname :: !Data.Text.Text, + _PingResponse'timestamp :: !Data.Text.Text, + _PingResponse'sha :: !Data.Text.Text, + _PingResponse'_unknownFields :: !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show PingResponse where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' PingResponse "status" + (Data.Text.Text) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _PingResponse'status + (\ x__ y__ -> x__{_PingResponse'status = y__})) + Prelude.id +instance Lens.Labels.HasLens' PingResponse "hostname" + (Data.Text.Text) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _PingResponse'hostname + (\ x__ y__ -> x__{_PingResponse'hostname = y__})) + Prelude.id +instance Lens.Labels.HasLens' PingResponse "timestamp" + (Data.Text.Text) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _PingResponse'timestamp + (\ x__ y__ -> x__{_PingResponse'timestamp = y__})) + Prelude.id +instance Lens.Labels.HasLens' PingResponse "sha" (Data.Text.Text) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _PingResponse'sha + (\ x__ y__ -> x__{_PingResponse'sha = y__})) + Prelude.id +instance Data.ProtoLens.Message PingResponse where + messageName _ = Data.Text.pack "github.semantic.PingResponse" + fieldsByTag + = let status__field_descriptor + = Data.ProtoLens.FieldDescriptor "status" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "status"))) + :: Data.ProtoLens.FieldDescriptor PingResponse + hostname__field_descriptor + = Data.ProtoLens.FieldDescriptor "hostname" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "hostname"))) + :: Data.ProtoLens.FieldDescriptor PingResponse + timestamp__field_descriptor + = Data.ProtoLens.FieldDescriptor "timestamp" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "timestamp"))) + :: Data.ProtoLens.FieldDescriptor PingResponse + sha__field_descriptor + = Data.ProtoLens.FieldDescriptor "sha" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "sha"))) + :: Data.ProtoLens.FieldDescriptor PingResponse + in + Data.Map.fromList + [(Data.ProtoLens.Tag 1, status__field_descriptor), + (Data.ProtoLens.Tag 2, hostname__field_descriptor), + (Data.ProtoLens.Tag 3, timestamp__field_descriptor), + (Data.ProtoLens.Tag 4, sha__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _PingResponse'_unknownFields + (\ x__ y__ -> x__{_PingResponse'_unknownFields = y__}) + defMessage + = PingResponse{_PingResponse'status = Data.ProtoLens.fieldDefault, + _PingResponse'hostname = Data.ProtoLens.fieldDefault, + _PingResponse'timestamp = Data.ProtoLens.fieldDefault, + _PingResponse'sha = Data.ProtoLens.fieldDefault, + _PingResponse'_unknownFields = ([])} +instance Control.DeepSeq.NFData PingResponse where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_PingResponse'_unknownFields x__) + (Control.DeepSeq.deepseq (_PingResponse'status x__) + (Control.DeepSeq.deepseq (_PingResponse'hostname x__) + (Control.DeepSeq.deepseq (_PingResponse'timestamp x__) + (Control.DeepSeq.deepseq (_PingResponse'sha x__) (()))))) +{- | Fields : + + * 'Proto.Semantic_Fields.line' @:: Lens' Position Data.Int.Int32@ + * 'Proto.Semantic_Fields.column' @:: Lens' Position Data.Int.Int32@ + -} +data Position = Position{_Position'line :: !Data.Int.Int32, + _Position'column :: !Data.Int.Int32, + _Position'_unknownFields :: !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show Position where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' Position "line" (Data.Int.Int32) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _Position'line + (\ x__ y__ -> x__{_Position'line = y__})) + Prelude.id +instance Lens.Labels.HasLens' Position "column" (Data.Int.Int32) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _Position'column + (\ x__ y__ -> x__{_Position'column = y__})) + Prelude.id +instance Data.ProtoLens.Message Position where + messageName _ = Data.Text.pack "github.semantic.Position" + fieldsByTag + = let line__field_descriptor + = Data.ProtoLens.FieldDescriptor "line" + (Data.ProtoLens.ScalarField Data.ProtoLens.Int32Field :: + Data.ProtoLens.FieldTypeDescriptor Data.Int.Int32) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "line"))) + :: Data.ProtoLens.FieldDescriptor Position + column__field_descriptor + = Data.ProtoLens.FieldDescriptor "column" + (Data.ProtoLens.ScalarField Data.ProtoLens.Int32Field :: + Data.ProtoLens.FieldTypeDescriptor Data.Int.Int32) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "column"))) + :: Data.ProtoLens.FieldDescriptor Position + in + Data.Map.fromList + [(Data.ProtoLens.Tag 1, line__field_descriptor), + (Data.ProtoLens.Tag 2, column__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _Position'_unknownFields + (\ x__ y__ -> x__{_Position'_unknownFields = y__}) + defMessage + = Position{_Position'line = Data.ProtoLens.fieldDefault, + _Position'column = Data.ProtoLens.fieldDefault, + _Position'_unknownFields = ([])} +instance Control.DeepSeq.NFData Position where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_Position'_unknownFields x__) + (Control.DeepSeq.deepseq (_Position'line x__) + (Control.DeepSeq.deepseq (_Position'column x__) (()))) +{- | Fields : + + * 'Proto.Semantic_Fields.beforeTerm' @:: Lens' ReplacedTerm Data.Text.Text@ + * 'Proto.Semantic_Fields.beforeSpan' @:: Lens' ReplacedTerm Span@ + * 'Proto.Semantic_Fields.maybe'beforeSpan' @:: Lens' ReplacedTerm (Prelude.Maybe Span)@ + * 'Proto.Semantic_Fields.afterTerm' @:: Lens' ReplacedTerm Data.Text.Text@ + * 'Proto.Semantic_Fields.afterSpan' @:: Lens' ReplacedTerm Span@ + * 'Proto.Semantic_Fields.maybe'afterSpan' @:: Lens' ReplacedTerm (Prelude.Maybe Span)@ + -} +data ReplacedTerm = ReplacedTerm{_ReplacedTerm'beforeTerm :: + !Data.Text.Text, + _ReplacedTerm'beforeSpan :: !(Prelude.Maybe Span), + _ReplacedTerm'afterTerm :: !Data.Text.Text, + _ReplacedTerm'afterSpan :: !(Prelude.Maybe Span), + _ReplacedTerm'_unknownFields :: !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show ReplacedTerm where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' ReplacedTerm "beforeTerm" + (Data.Text.Text) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _ReplacedTerm'beforeTerm + (\ x__ y__ -> x__{_ReplacedTerm'beforeTerm = y__})) + Prelude.id +instance Lens.Labels.HasLens' ReplacedTerm "beforeSpan" (Span) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _ReplacedTerm'beforeSpan + (\ x__ y__ -> x__{_ReplacedTerm'beforeSpan = y__})) + (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) +instance Lens.Labels.HasLens' ReplacedTerm "maybe'beforeSpan" + (Prelude.Maybe Span) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _ReplacedTerm'beforeSpan + (\ x__ y__ -> x__{_ReplacedTerm'beforeSpan = y__})) + Prelude.id +instance Lens.Labels.HasLens' ReplacedTerm "afterTerm" + (Data.Text.Text) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _ReplacedTerm'afterTerm + (\ x__ y__ -> x__{_ReplacedTerm'afterTerm = y__})) + Prelude.id +instance Lens.Labels.HasLens' ReplacedTerm "afterSpan" (Span) where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _ReplacedTerm'afterSpan + (\ x__ y__ -> x__{_ReplacedTerm'afterSpan = y__})) + (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) +instance Lens.Labels.HasLens' ReplacedTerm "maybe'afterSpan" + (Prelude.Maybe Span) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _ReplacedTerm'afterSpan + (\ x__ y__ -> x__{_ReplacedTerm'afterSpan = y__})) + Prelude.id +instance Data.ProtoLens.Message ReplacedTerm where + messageName _ = Data.Text.pack "github.semantic.ReplacedTerm" + fieldsByTag + = let beforeTerm__field_descriptor + = Data.ProtoLens.FieldDescriptor "before_term" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "beforeTerm"))) + :: Data.ProtoLens.FieldDescriptor ReplacedTerm + beforeSpan__field_descriptor + = Data.ProtoLens.FieldDescriptor "before_span" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor Span) + (Data.ProtoLens.OptionalField + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'beforeSpan"))) + :: Data.ProtoLens.FieldDescriptor ReplacedTerm + afterTerm__field_descriptor + = Data.ProtoLens.FieldDescriptor "after_term" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "afterTerm"))) + :: Data.ProtoLens.FieldDescriptor ReplacedTerm + afterSpan__field_descriptor + = Data.ProtoLens.FieldDescriptor "after_span" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor Span) + (Data.ProtoLens.OptionalField + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'afterSpan"))) + :: Data.ProtoLens.FieldDescriptor ReplacedTerm + in + Data.Map.fromList + [(Data.ProtoLens.Tag 1, beforeTerm__field_descriptor), + (Data.ProtoLens.Tag 2, beforeSpan__field_descriptor), + (Data.ProtoLens.Tag 3, afterTerm__field_descriptor), + (Data.ProtoLens.Tag 4, afterSpan__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _ReplacedTerm'_unknownFields + (\ x__ y__ -> x__{_ReplacedTerm'_unknownFields = y__}) + defMessage + = ReplacedTerm{_ReplacedTerm'beforeTerm = + Data.ProtoLens.fieldDefault, + _ReplacedTerm'beforeSpan = Prelude.Nothing, + _ReplacedTerm'afterTerm = Data.ProtoLens.fieldDefault, + _ReplacedTerm'afterSpan = Prelude.Nothing, + _ReplacedTerm'_unknownFields = ([])} +instance Control.DeepSeq.NFData ReplacedTerm where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_ReplacedTerm'_unknownFields x__) + (Control.DeepSeq.deepseq (_ReplacedTerm'beforeTerm x__) + (Control.DeepSeq.deepseq (_ReplacedTerm'beforeSpan x__) + (Control.DeepSeq.deepseq (_ReplacedTerm'afterTerm x__) + (Control.DeepSeq.deepseq (_ReplacedTerm'afterSpan x__) (()))))) +{- | Fields : + + * 'Proto.Semantic_Fields.start' @:: Lens' Span Position@ + * 'Proto.Semantic_Fields.maybe'start' @:: Lens' Span (Prelude.Maybe Position)@ + * 'Proto.Semantic_Fields.end' @:: Lens' Span Position@ + * 'Proto.Semantic_Fields.maybe'end' @:: Lens' Span (Prelude.Maybe Position)@ + -} +data Span = Span{_Span'start :: !(Prelude.Maybe Position), + _Span'end :: !(Prelude.Maybe Position), + _Span'_unknownFields :: !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show Span where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' Span "start" (Position) where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _Span'start + (\ x__ y__ -> x__{_Span'start = y__})) + (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) +instance Lens.Labels.HasLens' Span "maybe'start" + (Prelude.Maybe Position) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _Span'start + (\ x__ y__ -> x__{_Span'start = y__})) + Prelude.id +instance Lens.Labels.HasLens' Span "end" (Position) where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _Span'end + (\ x__ y__ -> x__{_Span'end = y__})) + (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) +instance Lens.Labels.HasLens' Span "maybe'end" + (Prelude.Maybe Position) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _Span'end + (\ x__ y__ -> x__{_Span'end = y__})) + Prelude.id +instance Data.ProtoLens.Message Span where + messageName _ = Data.Text.pack "github.semantic.Span" + fieldsByTag + = let start__field_descriptor + = Data.ProtoLens.FieldDescriptor "start" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor Position) + (Data.ProtoLens.OptionalField + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'start"))) + :: Data.ProtoLens.FieldDescriptor Span + end__field_descriptor + = Data.ProtoLens.FieldDescriptor "end" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor Position) + (Data.ProtoLens.OptionalField + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'end"))) + :: Data.ProtoLens.FieldDescriptor Span + in + Data.Map.fromList + [(Data.ProtoLens.Tag 1, start__field_descriptor), + (Data.ProtoLens.Tag 2, end__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _Span'_unknownFields + (\ x__ y__ -> x__{_Span'_unknownFields = y__}) + defMessage + = Span{_Span'start = Prelude.Nothing, _Span'end = Prelude.Nothing, + _Span'_unknownFields = ([])} +instance Control.DeepSeq.NFData Span where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_Span'_unknownFields x__) + (Control.DeepSeq.deepseq (_Span'start x__) + (Control.DeepSeq.deepseq (_Span'end x__) (()))) +{- | Fields : + + * 'Proto.Semantic_Fields.symbol' @:: Lens' Symbol Data.Text.Text@ + * 'Proto.Semantic_Fields.kind' @:: Lens' Symbol Data.Text.Text@ + * 'Proto.Semantic_Fields.line' @:: Lens' Symbol Data.Text.Text@ + * 'Proto.Semantic_Fields.span' @:: Lens' Symbol Span@ + * 'Proto.Semantic_Fields.maybe'span' @:: Lens' Symbol (Prelude.Maybe Span)@ + * 'Proto.Semantic_Fields.docs' @:: Lens' Symbol Docstring@ + * 'Proto.Semantic_Fields.maybe'docs' @:: Lens' Symbol (Prelude.Maybe Docstring)@ + -} +data Symbol = Symbol{_Symbol'symbol :: !Data.Text.Text, + _Symbol'kind :: !Data.Text.Text, _Symbol'line :: !Data.Text.Text, + _Symbol'span :: !(Prelude.Maybe Span), + _Symbol'docs :: !(Prelude.Maybe Docstring), + _Symbol'_unknownFields :: !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show Symbol where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' Symbol "symbol" (Data.Text.Text) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _Symbol'symbol + (\ x__ y__ -> x__{_Symbol'symbol = y__})) + Prelude.id +instance Lens.Labels.HasLens' Symbol "kind" (Data.Text.Text) where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _Symbol'kind + (\ x__ y__ -> x__{_Symbol'kind = y__})) + Prelude.id +instance Lens.Labels.HasLens' Symbol "line" (Data.Text.Text) where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _Symbol'line + (\ x__ y__ -> x__{_Symbol'line = y__})) + Prelude.id +instance Lens.Labels.HasLens' Symbol "span" (Span) where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _Symbol'span + (\ x__ y__ -> x__{_Symbol'span = y__})) + (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) +instance Lens.Labels.HasLens' Symbol "maybe'span" + (Prelude.Maybe Span) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _Symbol'span + (\ x__ y__ -> x__{_Symbol'span = y__})) + Prelude.id +instance Lens.Labels.HasLens' Symbol "docs" (Docstring) where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _Symbol'docs + (\ x__ y__ -> x__{_Symbol'docs = y__})) + (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) +instance Lens.Labels.HasLens' Symbol "maybe'docs" + (Prelude.Maybe Docstring) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _Symbol'docs + (\ x__ y__ -> x__{_Symbol'docs = y__})) + Prelude.id +instance Data.ProtoLens.Message Symbol where + messageName _ = Data.Text.pack "github.semantic.Symbol" + fieldsByTag + = let symbol__field_descriptor + = Data.ProtoLens.FieldDescriptor "symbol" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "symbol"))) + :: Data.ProtoLens.FieldDescriptor Symbol + kind__field_descriptor + = Data.ProtoLens.FieldDescriptor "kind" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "kind"))) + :: Data.ProtoLens.FieldDescriptor Symbol + line__field_descriptor + = Data.ProtoLens.FieldDescriptor "line" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "line"))) + :: Data.ProtoLens.FieldDescriptor Symbol + span__field_descriptor + = Data.ProtoLens.FieldDescriptor "span" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor Span) + (Data.ProtoLens.OptionalField + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'span"))) + :: Data.ProtoLens.FieldDescriptor Symbol + docs__field_descriptor + = Data.ProtoLens.FieldDescriptor "docs" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor Docstring) + (Data.ProtoLens.OptionalField + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'docs"))) + :: Data.ProtoLens.FieldDescriptor Symbol + in + Data.Map.fromList + [(Data.ProtoLens.Tag 1, symbol__field_descriptor), + (Data.ProtoLens.Tag 2, kind__field_descriptor), + (Data.ProtoLens.Tag 3, line__field_descriptor), + (Data.ProtoLens.Tag 4, span__field_descriptor), + (Data.ProtoLens.Tag 5, docs__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _Symbol'_unknownFields + (\ x__ y__ -> x__{_Symbol'_unknownFields = y__}) + defMessage + = Symbol{_Symbol'symbol = Data.ProtoLens.fieldDefault, + _Symbol'kind = Data.ProtoLens.fieldDefault, + _Symbol'line = Data.ProtoLens.fieldDefault, + _Symbol'span = Prelude.Nothing, _Symbol'docs = Prelude.Nothing, + _Symbol'_unknownFields = ([])} +instance Control.DeepSeq.NFData Symbol where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_Symbol'_unknownFields x__) + (Control.DeepSeq.deepseq (_Symbol'symbol x__) + (Control.DeepSeq.deepseq (_Symbol'kind x__) + (Control.DeepSeq.deepseq (_Symbol'line x__) + (Control.DeepSeq.deepseq (_Symbol'span x__) + (Control.DeepSeq.deepseq (_Symbol'docs x__) (())))))) +{- | Fields : + + * 'Proto.Semantic_Fields.category' @:: Lens' TOCSummaryChange Data.Text.Text@ + * 'Proto.Semantic_Fields.term' @:: Lens' TOCSummaryChange Data.Text.Text@ + * 'Proto.Semantic_Fields.span' @:: Lens' TOCSummaryChange Span@ + * 'Proto.Semantic_Fields.maybe'span' @:: Lens' TOCSummaryChange (Prelude.Maybe Span)@ + * 'Proto.Semantic_Fields.changeType' @:: Lens' TOCSummaryChange ChangeType@ + -} +data TOCSummaryChange = TOCSummaryChange{_TOCSummaryChange'category + :: !Data.Text.Text, + _TOCSummaryChange'term :: !Data.Text.Text, + _TOCSummaryChange'span :: !(Prelude.Maybe Span), + _TOCSummaryChange'changeType :: !ChangeType, + _TOCSummaryChange'_unknownFields :: + !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show TOCSummaryChange where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' TOCSummaryChange "category" + (Data.Text.Text) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _TOCSummaryChange'category + (\ x__ y__ -> x__{_TOCSummaryChange'category = y__})) + Prelude.id +instance Lens.Labels.HasLens' TOCSummaryChange "term" + (Data.Text.Text) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _TOCSummaryChange'term + (\ x__ y__ -> x__{_TOCSummaryChange'term = y__})) + Prelude.id +instance Lens.Labels.HasLens' TOCSummaryChange "span" (Span) where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _TOCSummaryChange'span + (\ x__ y__ -> x__{_TOCSummaryChange'span = y__})) + (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) +instance Lens.Labels.HasLens' TOCSummaryChange "maybe'span" + (Prelude.Maybe Span) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _TOCSummaryChange'span + (\ x__ y__ -> x__{_TOCSummaryChange'span = y__})) + Prelude.id +instance Lens.Labels.HasLens' TOCSummaryChange "changeType" + (ChangeType) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _TOCSummaryChange'changeType + (\ x__ y__ -> x__{_TOCSummaryChange'changeType = y__})) + Prelude.id +instance Data.ProtoLens.Message TOCSummaryChange where + messageName _ = Data.Text.pack "github.semantic.TOCSummaryChange" + fieldsByTag + = let category__field_descriptor + = Data.ProtoLens.FieldDescriptor "category" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "category"))) + :: Data.ProtoLens.FieldDescriptor TOCSummaryChange + term__field_descriptor + = Data.ProtoLens.FieldDescriptor "term" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "term"))) + :: Data.ProtoLens.FieldDescriptor TOCSummaryChange + span__field_descriptor + = Data.ProtoLens.FieldDescriptor "span" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor Span) + (Data.ProtoLens.OptionalField + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'span"))) + :: Data.ProtoLens.FieldDescriptor TOCSummaryChange + changeType__field_descriptor + = Data.ProtoLens.FieldDescriptor "change_type" + (Data.ProtoLens.ScalarField Data.ProtoLens.EnumField :: + Data.ProtoLens.FieldTypeDescriptor ChangeType) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "changeType"))) + :: Data.ProtoLens.FieldDescriptor TOCSummaryChange + in + Data.Map.fromList + [(Data.ProtoLens.Tag 1, category__field_descriptor), + (Data.ProtoLens.Tag 2, term__field_descriptor), + (Data.ProtoLens.Tag 3, span__field_descriptor), + (Data.ProtoLens.Tag 4, changeType__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _TOCSummaryChange'_unknownFields + (\ x__ y__ -> x__{_TOCSummaryChange'_unknownFields = y__}) + defMessage + = TOCSummaryChange{_TOCSummaryChange'category = + Data.ProtoLens.fieldDefault, + _TOCSummaryChange'term = Data.ProtoLens.fieldDefault, + _TOCSummaryChange'span = Prelude.Nothing, + _TOCSummaryChange'changeType = Data.ProtoLens.fieldDefault, + _TOCSummaryChange'_unknownFields = ([])} +instance Control.DeepSeq.NFData TOCSummaryChange where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_TOCSummaryChange'_unknownFields x__) + (Control.DeepSeq.deepseq (_TOCSummaryChange'category x__) + (Control.DeepSeq.deepseq (_TOCSummaryChange'term x__) + (Control.DeepSeq.deepseq (_TOCSummaryChange'span x__) + (Control.DeepSeq.deepseq (_TOCSummaryChange'changeType x__) + (()))))) +{- | Fields : + + * 'Proto.Semantic_Fields.error' @:: Lens' TOCSummaryError Data.Text.Text@ + * 'Proto.Semantic_Fields.span' @:: Lens' TOCSummaryError Span@ + * 'Proto.Semantic_Fields.maybe'span' @:: Lens' TOCSummaryError (Prelude.Maybe Span)@ + -} +data TOCSummaryError = TOCSummaryError{_TOCSummaryError'error :: + !Data.Text.Text, + _TOCSummaryError'span :: !(Prelude.Maybe Span), + _TOCSummaryError'_unknownFields :: !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show TOCSummaryError where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' TOCSummaryError "error" + (Data.Text.Text) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _TOCSummaryError'error + (\ x__ y__ -> x__{_TOCSummaryError'error = y__})) + Prelude.id +instance Lens.Labels.HasLens' TOCSummaryError "span" (Span) where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _TOCSummaryError'span + (\ x__ y__ -> x__{_TOCSummaryError'span = y__})) + (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) +instance Lens.Labels.HasLens' TOCSummaryError "maybe'span" + (Prelude.Maybe Span) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _TOCSummaryError'span + (\ x__ y__ -> x__{_TOCSummaryError'span = y__})) + Prelude.id +instance Data.ProtoLens.Message TOCSummaryError where + messageName _ = Data.Text.pack "github.semantic.TOCSummaryError" + fieldsByTag + = let error__field_descriptor + = Data.ProtoLens.FieldDescriptor "error" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "error"))) + :: Data.ProtoLens.FieldDescriptor TOCSummaryError + span__field_descriptor + = Data.ProtoLens.FieldDescriptor "span" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor Span) + (Data.ProtoLens.OptionalField + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'span"))) + :: Data.ProtoLens.FieldDescriptor TOCSummaryError + in + Data.Map.fromList + [(Data.ProtoLens.Tag 1, error__field_descriptor), + (Data.ProtoLens.Tag 2, span__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _TOCSummaryError'_unknownFields + (\ x__ y__ -> x__{_TOCSummaryError'_unknownFields = y__}) + defMessage + = TOCSummaryError{_TOCSummaryError'error = + Data.ProtoLens.fieldDefault, + _TOCSummaryError'span = Prelude.Nothing, + _TOCSummaryError'_unknownFields = ([])} +instance Control.DeepSeq.NFData TOCSummaryError where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_TOCSummaryError'_unknownFields x__) + (Control.DeepSeq.deepseq (_TOCSummaryError'error x__) + (Control.DeepSeq.deepseq (_TOCSummaryError'span x__) (()))) +{- | Fields : + + * 'Proto.Semantic_Fields.path' @:: Lens' TOCSummaryFile Data.Text.Text@ + * 'Proto.Semantic_Fields.language' @:: Lens' TOCSummaryFile Data.Text.Text@ + * 'Proto.Semantic_Fields.changes' @:: Lens' TOCSummaryFile [TOCSummaryChange]@ + * 'Proto.Semantic_Fields.errors' @:: Lens' TOCSummaryFile [TOCSummaryError]@ + -} +data TOCSummaryFile = TOCSummaryFile{_TOCSummaryFile'path :: + !Data.Text.Text, + _TOCSummaryFile'language :: !Data.Text.Text, + _TOCSummaryFile'changes :: ![TOCSummaryChange], + _TOCSummaryFile'errors :: ![TOCSummaryError], + _TOCSummaryFile'_unknownFields :: !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show TOCSummaryFile where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' TOCSummaryFile "path" + (Data.Text.Text) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _TOCSummaryFile'path + (\ x__ y__ -> x__{_TOCSummaryFile'path = y__})) + Prelude.id +instance Lens.Labels.HasLens' TOCSummaryFile "language" + (Data.Text.Text) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _TOCSummaryFile'language + (\ x__ y__ -> x__{_TOCSummaryFile'language = y__})) + Prelude.id +instance Lens.Labels.HasLens' TOCSummaryFile "changes" + ([TOCSummaryChange]) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _TOCSummaryFile'changes + (\ x__ y__ -> x__{_TOCSummaryFile'changes = y__})) + Prelude.id +instance Lens.Labels.HasLens' TOCSummaryFile "errors" + ([TOCSummaryError]) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _TOCSummaryFile'errors + (\ x__ y__ -> x__{_TOCSummaryFile'errors = y__})) + Prelude.id +instance Data.ProtoLens.Message TOCSummaryFile where + messageName _ = Data.Text.pack "github.semantic.TOCSummaryFile" + fieldsByTag + = let path__field_descriptor + = Data.ProtoLens.FieldDescriptor "path" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "path"))) + :: Data.ProtoLens.FieldDescriptor TOCSummaryFile + language__field_descriptor + = Data.ProtoLens.FieldDescriptor "language" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "language"))) + :: Data.ProtoLens.FieldDescriptor TOCSummaryFile + changes__field_descriptor + = Data.ProtoLens.FieldDescriptor "changes" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor TOCSummaryChange) + (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "changes"))) + :: Data.ProtoLens.FieldDescriptor TOCSummaryFile + errors__field_descriptor + = Data.ProtoLens.FieldDescriptor "errors" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor TOCSummaryError) + (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "errors"))) + :: Data.ProtoLens.FieldDescriptor TOCSummaryFile + in + Data.Map.fromList + [(Data.ProtoLens.Tag 1, path__field_descriptor), + (Data.ProtoLens.Tag 2, language__field_descriptor), + (Data.ProtoLens.Tag 3, changes__field_descriptor), + (Data.ProtoLens.Tag 4, errors__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _TOCSummaryFile'_unknownFields + (\ x__ y__ -> x__{_TOCSummaryFile'_unknownFields = y__}) + defMessage + = TOCSummaryFile{_TOCSummaryFile'path = + Data.ProtoLens.fieldDefault, + _TOCSummaryFile'language = Data.ProtoLens.fieldDefault, + _TOCSummaryFile'changes = [], _TOCSummaryFile'errors = [], + _TOCSummaryFile'_unknownFields = ([])} +instance Control.DeepSeq.NFData TOCSummaryFile where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_TOCSummaryFile'_unknownFields x__) + (Control.DeepSeq.deepseq (_TOCSummaryFile'path x__) + (Control.DeepSeq.deepseq (_TOCSummaryFile'language x__) + (Control.DeepSeq.deepseq (_TOCSummaryFile'changes x__) + (Control.DeepSeq.deepseq (_TOCSummaryFile'errors x__) (()))))) +{- | Fields : + + * 'Proto.Semantic_Fields.source' @:: Lens' TermEdge Data.Int.Int32@ + * 'Proto.Semantic_Fields.target' @:: Lens' TermEdge Data.Int.Int32@ + -} +data TermEdge = TermEdge{_TermEdge'source :: !Data.Int.Int32, + _TermEdge'target :: !Data.Int.Int32, + _TermEdge'_unknownFields :: !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show TermEdge where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' TermEdge "source" (Data.Int.Int32) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _TermEdge'source + (\ x__ y__ -> x__{_TermEdge'source = y__})) + Prelude.id +instance Lens.Labels.HasLens' TermEdge "target" (Data.Int.Int32) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _TermEdge'target + (\ x__ y__ -> x__{_TermEdge'target = y__})) + Prelude.id +instance Data.ProtoLens.Message TermEdge where + messageName _ = Data.Text.pack "github.semantic.TermEdge" + fieldsByTag + = let source__field_descriptor + = Data.ProtoLens.FieldDescriptor "source" + (Data.ProtoLens.ScalarField Data.ProtoLens.Int32Field :: + Data.ProtoLens.FieldTypeDescriptor Data.Int.Int32) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "source"))) + :: Data.ProtoLens.FieldDescriptor TermEdge + target__field_descriptor + = Data.ProtoLens.FieldDescriptor "target" + (Data.ProtoLens.ScalarField Data.ProtoLens.Int32Field :: + Data.ProtoLens.FieldTypeDescriptor Data.Int.Int32) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "target"))) + :: Data.ProtoLens.FieldDescriptor TermEdge + in + Data.Map.fromList + [(Data.ProtoLens.Tag 1, source__field_descriptor), + (Data.ProtoLens.Tag 2, target__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _TermEdge'_unknownFields + (\ x__ y__ -> x__{_TermEdge'_unknownFields = y__}) + defMessage + = TermEdge{_TermEdge'source = Data.ProtoLens.fieldDefault, + _TermEdge'target = Data.ProtoLens.fieldDefault, + _TermEdge'_unknownFields = ([])} +instance Control.DeepSeq.NFData TermEdge where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_TermEdge'_unknownFields x__) + (Control.DeepSeq.deepseq (_TermEdge'source x__) + (Control.DeepSeq.deepseq (_TermEdge'target x__) (()))) +{- | Fields : + + * 'Proto.Semantic_Fields.vertexId' @:: Lens' TermVertex Data.Int.Int32@ + * 'Proto.Semantic_Fields.term' @:: Lens' TermVertex Data.Text.Text@ + * 'Proto.Semantic_Fields.span' @:: Lens' TermVertex Span@ + * 'Proto.Semantic_Fields.maybe'span' @:: Lens' TermVertex (Prelude.Maybe Span)@ + -} +data TermVertex = TermVertex{_TermVertex'vertexId :: + !Data.Int.Int32, + _TermVertex'term :: !Data.Text.Text, + _TermVertex'span :: !(Prelude.Maybe Span), + _TermVertex'_unknownFields :: !Data.ProtoLens.FieldSet} + deriving (Prelude.Eq, Prelude.Ord) +instance Prelude.Show TermVertex where + showsPrec _ __x __s + = Prelude.showChar '{' + (Prelude.showString (Data.ProtoLens.showMessageShort __x) + (Prelude.showChar '}' __s)) +instance Lens.Labels.HasLens' TermVertex "vertexId" + (Data.Int.Int32) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _TermVertex'vertexId + (\ x__ y__ -> x__{_TermVertex'vertexId = y__})) + Prelude.id +instance Lens.Labels.HasLens' TermVertex "term" (Data.Text.Text) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _TermVertex'term + (\ x__ y__ -> x__{_TermVertex'term = y__})) + Prelude.id +instance Lens.Labels.HasLens' TermVertex "span" (Span) where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _TermVertex'span + (\ x__ y__ -> x__{_TermVertex'span = y__})) + (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) +instance Lens.Labels.HasLens' TermVertex "maybe'span" + (Prelude.Maybe Span) + where + lensOf' _ + = (Prelude..) + (Lens.Family2.Unchecked.lens _TermVertex'span + (\ x__ y__ -> x__{_TermVertex'span = y__})) + Prelude.id +instance Data.ProtoLens.Message TermVertex where + messageName _ = Data.Text.pack "github.semantic.TermVertex" + fieldsByTag + = let vertexId__field_descriptor + = Data.ProtoLens.FieldDescriptor "vertex_id" + (Data.ProtoLens.ScalarField Data.ProtoLens.Int32Field :: + Data.ProtoLens.FieldTypeDescriptor Data.Int.Int32) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "vertexId"))) + :: Data.ProtoLens.FieldDescriptor TermVertex + term__field_descriptor + = Data.ProtoLens.FieldDescriptor "term" + (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: + Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) + (Data.ProtoLens.PlainField Data.ProtoLens.Optional + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "term"))) + :: Data.ProtoLens.FieldDescriptor TermVertex + span__field_descriptor + = Data.ProtoLens.FieldDescriptor "span" + (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: + Data.ProtoLens.FieldTypeDescriptor Span) + (Data.ProtoLens.OptionalField + (Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'span"))) + :: Data.ProtoLens.FieldDescriptor TermVertex + in + Data.Map.fromList + [(Data.ProtoLens.Tag 1, vertexId__field_descriptor), + (Data.ProtoLens.Tag 2, term__field_descriptor), + (Data.ProtoLens.Tag 3, span__field_descriptor)] + unknownFields + = Lens.Family2.Unchecked.lens _TermVertex'_unknownFields + (\ x__ y__ -> x__{_TermVertex'_unknownFields = y__}) + defMessage + = TermVertex{_TermVertex'vertexId = Data.ProtoLens.fieldDefault, + _TermVertex'term = Data.ProtoLens.fieldDefault, + _TermVertex'span = Prelude.Nothing, + _TermVertex'_unknownFields = ([])} +instance Control.DeepSeq.NFData TermVertex where + rnf + = \ x__ -> + Control.DeepSeq.deepseq (_TermVertex'_unknownFields x__) + (Control.DeepSeq.deepseq (_TermVertex'vertexId x__) + (Control.DeepSeq.deepseq (_TermVertex'term x__) + (Control.DeepSeq.deepseq (_TermVertex'span x__) (())))) diff --git a/src/Proto/Semantic_Fields.hs b/src/Proto/Semantic_Fields.hs new file mode 100644 index 0000000000..04df624afc --- /dev/null +++ b/src/Proto/Semantic_Fields.hs @@ -0,0 +1,423 @@ +{- This file was auto-generated from semantic.proto by the proto-lens-protoc program. -} +{-# LANGUAGE ScopedTypeVariables, DataKinds, TypeFamilies, + UndecidableInstances, GeneralizedNewtypeDeriving, + MultiParamTypeClasses, FlexibleContexts, FlexibleInstances, + PatternSynonyms, MagicHash, NoImplicitPrelude, DataKinds #-} +{-# OPTIONS_GHC -fno-warn-unused-imports#-} +{-# OPTIONS_GHC -fno-warn-duplicate-exports#-} +module Proto.Semantic_Fields where +import qualified Data.ProtoLens.Runtime.Prelude as Prelude +import qualified Data.ProtoLens.Runtime.Data.Int as Data.Int +import qualified Data.ProtoLens.Runtime.Data.Word as Data.Word +import qualified Data.ProtoLens.Runtime.Data.ProtoLens + as Data.ProtoLens +import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Message.Enum + as Data.ProtoLens.Message.Enum +import qualified + Data.ProtoLens.Runtime.Data.ProtoLens.Service.Types + as Data.ProtoLens.Service.Types +import qualified Data.ProtoLens.Runtime.Lens.Family2 + as Lens.Family2 +import qualified Data.ProtoLens.Runtime.Lens.Family2.Unchecked + as Lens.Family2.Unchecked +import qualified Data.ProtoLens.Runtime.Data.Text as Data.Text +import qualified Data.ProtoLens.Runtime.Data.Map as Data.Map +import qualified Data.ProtoLens.Runtime.Data.ByteString + as Data.ByteString +import qualified Data.ProtoLens.Runtime.Data.ByteString.Char8 + as Data.ByteString.Char8 +import qualified Data.ProtoLens.Runtime.Lens.Labels as Lens.Labels +import qualified Data.ProtoLens.Runtime.Text.Read as Text.Read + +after :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "after" a) => + Lens.Family2.LensLike' f s a +after + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "after") +afterSpan :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "afterSpan" a) => + Lens.Family2.LensLike' f s a +afterSpan + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "afterSpan") +afterTerm :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "afterTerm" a) => + Lens.Family2.LensLike' f s a +afterTerm + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "afterTerm") +before :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "before" a) => + Lens.Family2.LensLike' f s a +before + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "before") +beforeSpan :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "beforeSpan" a) => + Lens.Family2.LensLike' f s a +beforeSpan + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "beforeSpan") +beforeTerm :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "beforeTerm" a) => + Lens.Family2.LensLike' f s a +beforeTerm + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "beforeTerm") +blobOid :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "blobOid" a) => + Lens.Family2.LensLike' f s a +blobOid + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "blobOid") +blobs :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "blobs" a) => + Lens.Family2.LensLike' f s a +blobs + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "blobs") +category :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "category" a) => + Lens.Family2.LensLike' f s a +category + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "category") +changeType :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "changeType" a) => + Lens.Family2.LensLike' f s a +changeType + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "changeType") +changes :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "changes" a) => + Lens.Family2.LensLike' f s a +changes + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "changes") +column :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "column" a) => + Lens.Family2.LensLike' f s a +column + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "column") +content :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "content" a) => + Lens.Family2.LensLike' f s a +content + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "content") +deleted :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "deleted" a) => + Lens.Family2.LensLike' f s a +deleted + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "deleted") +diffVertexId :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "diffVertexId" a) => + Lens.Family2.LensLike' f s a +diffVertexId + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "diffVertexId") +docs :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "docs" a) => + Lens.Family2.LensLike' f s a +docs + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "docs") +docstring :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "docstring" a) => + Lens.Family2.LensLike' f s a +docstring + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "docstring") +edges :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "edges" a) => + Lens.Family2.LensLike' f s a +edges + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "edges") +end :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "end" a) => + Lens.Family2.LensLike' f s a +end + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "end") +error :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "error" a) => + Lens.Family2.LensLike' f s a +error + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "error") +errors :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "errors" a) => + Lens.Family2.LensLike' f s a +errors + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "errors") +files :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "files" a) => + Lens.Family2.LensLike' f s a +files + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "files") +hostname :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "hostname" a) => + Lens.Family2.LensLike' f s a +hostname + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "hostname") +inserted :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "inserted" a) => + Lens.Family2.LensLike' f s a +inserted + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "inserted") +kind :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "kind" a) => + Lens.Family2.LensLike' f s a +kind + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "kind") +language :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "language" a) => + Lens.Family2.LensLike' f s a +language + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "language") +line :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "line" a) => + Lens.Family2.LensLike' f s a +line + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "line") +maybe'after :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'after" a) => + Lens.Family2.LensLike' f s a +maybe'after + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'after") +maybe'afterSpan :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'afterSpan" a) => + Lens.Family2.LensLike' f s a +maybe'afterSpan + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'afterSpan") +maybe'before :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'before" a) => + Lens.Family2.LensLike' f s a +maybe'before + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'before") +maybe'beforeSpan :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'beforeSpan" a) => + Lens.Family2.LensLike' f s a +maybe'beforeSpan + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'beforeSpan") +maybe'deleted :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'deleted" a) => + Lens.Family2.LensLike' f s a +maybe'deleted + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'deleted") +maybe'diffTerm :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'diffTerm" a) => + Lens.Family2.LensLike' f s a +maybe'diffTerm + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'diffTerm") +maybe'docs :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'docs" a) => + Lens.Family2.LensLike' f s a +maybe'docs + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'docs") +maybe'end :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'end" a) => + Lens.Family2.LensLike' f s a +maybe'end + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'end") +maybe'inserted :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'inserted" a) => + Lens.Family2.LensLike' f s a +maybe'inserted + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'inserted") +maybe'merged :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'merged" a) => + Lens.Family2.LensLike' f s a +maybe'merged + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'merged") +maybe'replaced :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'replaced" a) => + Lens.Family2.LensLike' f s a +maybe'replaced + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'replaced") +maybe'span :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'span" a) => + Lens.Family2.LensLike' f s a +maybe'span + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'span") +maybe'start :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'start" a) => + Lens.Family2.LensLike' f s a +maybe'start + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'start") +merged :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "merged" a) => + Lens.Family2.LensLike' f s a +merged + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "merged") +path :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "path" a) => + Lens.Family2.LensLike' f s a +path + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "path") +replaced :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "replaced" a) => + Lens.Family2.LensLike' f s a +replaced + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "replaced") +service :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "service" a) => + Lens.Family2.LensLike' f s a +service + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "service") +sha :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "sha" a) => + Lens.Family2.LensLike' f s a +sha + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "sha") +source :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "source" a) => + Lens.Family2.LensLike' f s a +source + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "source") +span :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "span" a) => + Lens.Family2.LensLike' f s a +span + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "span") +start :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "start" a) => + Lens.Family2.LensLike' f s a +start + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "start") +status :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "status" a) => + Lens.Family2.LensLike' f s a +status + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "status") +symbol :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "symbol" a) => + Lens.Family2.LensLike' f s a +symbol + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "symbol") +symbols :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "symbols" a) => + Lens.Family2.LensLike' f s a +symbols + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "symbols") +target :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "target" a) => + Lens.Family2.LensLike' f s a +target + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "target") +term :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "term" a) => + Lens.Family2.LensLike' f s a +term + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "term") +timestamp :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "timestamp" a) => + Lens.Family2.LensLike' f s a +timestamp + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "timestamp") +vertexId :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "vertexId" a) => + Lens.Family2.LensLike' f s a +vertexId + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "vertexId") +vertices :: + forall f s a . + (Prelude.Functor f, Lens.Labels.HasLens' s "vertices" a) => + Lens.Family2.LensLike' f s a +vertices + = Lens.Labels.lensOf' + ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "vertices") \ No newline at end of file diff --git a/src/Rendering/Graph.hs b/src/Rendering/Graph.hs index e151edb6a4..c5963e8f2f 100644 --- a/src/Rendering/Graph.hs +++ b/src/Rendering/Graph.hs @@ -12,14 +12,17 @@ import Control.Effect.Fresh import Control.Effect.Pure import Control.Effect.Reader import Control.Effect.State +import Control.Lens import Data.Diff import Data.Graph import Data.Patch +import Data.ProtoLens (defMessage) import Data.String (IsString (..)) import Data.Term import Prologue import Semantic.Api.Bridge -import Semantic.Proto.SemanticPB +import Proto.Semantic as P +import Proto.Semantic_Fields as P import Source.Loc as Loc import qualified Data.Text as T @@ -39,23 +42,24 @@ runGraph = run . runFresh' . runReader mempty -- | GraphViz styling for terms termStyle :: (IsString string, Monoid string) => String -> Style TermVertex string -termStyle name = (defaultStyle (fromString . show . vertexId)) +termStyle name = (defaultStyle (fromString . show . view vertexId)) { graphName = fromString (quote name) , vertexAttributes = vertexAttributes } where quote a = "\"" <> a <> "\"" - vertexAttributes TermVertex{..} = ["label" := fromString name] + vertexAttributes v = ["label" := fromString (T.unpack (v^.term))] -- | Graphviz styling for diffs diffStyle :: (IsString string, Monoid string) => String -> Style DiffTreeVertex string -diffStyle name = (defaultStyle (fromString . show . diffVertexId)) +diffStyle name = (defaultStyle (fromString . show . view diffVertexId)) { graphName = fromString (quote name) , vertexAttributes = vertexAttributes } where quote a = "\"" <> a <> "\"" - vertexAttributes (DiffTreeVertex _ (Just (Deleted (Just DeletedTerm{..})))) = [ "label" := fromString (T.unpack term), "color" := "red" ] - vertexAttributes (DiffTreeVertex _ (Just (Inserted (Just InsertedTerm{..})))) = [ "label" := fromString (T.unpack term), "color" := "green" ] - vertexAttributes (DiffTreeVertex _ (Just (Replaced (Just ReplacedTerm{..})))) = [ "label" := "Replacement", "color" := "orange", "style" := "dashed" ] - vertexAttributes (DiffTreeVertex _ (Just (Merged (Just MergedTerm{..})))) = [ "label" := fromString (T.unpack term) ] - vertexAttributes _ = [] + vertexAttributes v = case v^.maybe'diffTerm of + Just (DiffTreeVertex'Deleted x) -> [ "label" := fromString (T.unpack (x^.term)), "color" := "red" ] + Just (DiffTreeVertex'Inserted x) -> [ "label" := fromString (T.unpack (x^.term)), "color" := "green" ] + Just (DiffTreeVertex'Replaced x) -> [ "label" := "Replacement", "color" := "orange", "style" := "dashed" ] + Just (DiffTreeVertex'Merged x) -> [ "label" := fromString (T.unpack (x^.term)) ] + _ -> [] class ToTreeGraph vertex t | t -> vertex where toTreeGraph :: (Member Fresh sig, Member (Reader (Graph vertex)) sig, Carrier sig m) => t (m (Graph vertex)) -> m (Graph vertex) @@ -75,23 +79,40 @@ instance (ConstructorName syntax, Foldable syntax) => termAlgebra (In ann syntax) = do i <- fresh parent <- ask - let root = vertex $ TermVertex (fromIntegral i) (T.pack (constructorName syntax)) (converting #? Loc.span ann) + let root = vertex $ defMessage + & P.vertexId .~ fromIntegral i + & P.term .~ T.pack (constructorName syntax) + & P.maybe'span .~ (converting #? Loc.span ann) subGraph <- foldl' (\acc x -> overlay <$> acc <*> local (const root) x) (pure mempty) syntax pure (parent `connect` root `overlay` subGraph) instance (ConstructorName syntax, Foldable syntax) => ToTreeGraph DiffTreeVertex (DiffF syntax Loc Loc) where toTreeGraph d = case d of - Merge t@(In (a1, a2) syntax) -> diffAlgebra t (Merged (Just (MergedTerm (T.pack (constructorName syntax)) (ann a1) (ann a2)))) - Patch (Delete t1@(In a1 syntax)) -> diffAlgebra t1 (Deleted (Just (DeletedTerm (T.pack (constructorName syntax)) (ann a1)))) - Patch (Insert t2@(In a2 syntax)) -> diffAlgebra t2 (Inserted (Just (InsertedTerm (T.pack (constructorName syntax)) (ann a2)))) + Merge t@(In (a1, a2) syntax) -> diffAlgebra t . DiffTreeVertex'Merged $ defMessage + & P.term .~ T.pack (constructorName syntax) + & P.maybe'beforeSpan .~ ann a1 + & P.maybe'afterSpan .~ ann a2 + Patch (Delete t1@(In a1 syntax)) -> diffAlgebra t1 . DiffTreeVertex'Deleted $ defMessage + & P.term .~ T.pack (constructorName syntax) + & P.maybe'span .~ ann a1 + Patch (Insert t2@(In a2 syntax)) -> diffAlgebra t2 . DiffTreeVertex'Inserted $ defMessage + & P.term .~ T.pack (constructorName syntax) + & P.maybe'span .~ ann a2 Patch (Replace t1@(In a1 syntax1) t2@(In a2 syntax2)) -> do i <- fresh parent <- ask let (beforeName, beforeSpan) = (T.pack (constructorName syntax1), ann a1) let (afterName, afterSpan) = (T.pack (constructorName syntax2), ann a2) - let replace = vertex (DiffTreeVertex (fromIntegral i) (Just (Replaced (Just (ReplacedTerm beforeName beforeSpan afterName afterSpan))))) - graph <- local (const replace) (overlay <$> diffAlgebra t1 (Deleted (Just (DeletedTerm beforeName beforeSpan))) <*> diffAlgebra t2 (Inserted (Just (InsertedTerm afterName afterSpan)))) + let replace = vertex $ defMessage + & P.diffVertexId .~ fromIntegral i + & P.maybe'replaced ?~ (defMessage + & P.beforeTerm .~ beforeName + & P.maybe'beforeSpan .~ beforeSpan + & P.afterTerm .~ afterName + & P.maybe'afterSpan .~ afterSpan) + -- graph <- local (const replace) (overlay <$> diffAlgebra t1 (Deleted (Just (DeletedTerm beforeName beforeSpan))) <*> diffAlgebra t2 (Inserted (Just (InsertedTerm afterName afterSpan)))) + graph <- local (const replace) (overlay <$> diffAlgebra t1 (DiffTreeVertex'Deleted (defMessage & P.term .~ beforeName & P.maybe'span .~ beforeSpan)) <*> diffAlgebra t2 (DiffTreeVertex'Inserted (defMessage & P.term .~ afterName & P.maybe'span .~ afterSpan))) pure (parent `connect` replace `overlay` graph) where ann a = converting #? Loc.span a @@ -100,10 +121,12 @@ instance (ConstructorName syntax, Foldable syntax) => , Member Fresh sig , Member (Reader (Graph DiffTreeVertex)) sig , Carrier sig m - ) => f (m (Graph DiffTreeVertex)) -> DiffTreeVertexDiffTerm -> m (Graph DiffTreeVertex) + ) => f (m (Graph DiffTreeVertex)) -> DiffTreeVertex'DiffTerm -> m (Graph DiffTreeVertex) diffAlgebra syntax a = do i <- fresh parent <- ask - let root = vertex (DiffTreeVertex (fromIntegral i) (Just a)) + let root = vertex $ defMessage + & P.diffVertexId .~ fromIntegral i + & P.maybe'diffTerm ?~ a subGraph <- foldl' (\acc x -> overlay <$> acc <*> local (const root) x) (pure mempty) syntax pure (parent `connect` root `overlay` subGraph) diff --git a/src/Semantic/Api.hs b/src/Semantic/Api.hs index cbdd2432f9..546dcc92e0 100644 --- a/src/Semantic/Api.hs +++ b/src/Semantic/Api.hs @@ -11,4 +11,4 @@ import Semantic.Api.Diffs as DiffsAPI import Semantic.Api.Symbols as SymbolsAPI import Semantic.Api.Terms as TermsAPI import Semantic.Api.TOCSummaries as TOCSummariesAPI -import Semantic.Proto.SemanticPB as Types +import Proto.Semantic as Types diff --git a/src/Semantic/Api/Bridge.hs b/src/Semantic/Api/Bridge.hs index 4ec705d9b1..dee30b8ea7 100644 --- a/src/Semantic/Api/Bridge.hs +++ b/src/Semantic/Api/Bridge.hs @@ -8,9 +8,11 @@ module Semantic.Api.Bridge import Control.Lens import qualified Data.Blob as Data import qualified Data.Language as Data +import Data.ProtoLens (defMessage) import qualified Data.Text as T import qualified Semantic.Api.LegacyTypes as Legacy -import qualified Semantic.Proto.SemanticPB as API +import qualified Proto.Semantic as API +import Proto.Semantic_Fields as P import Source.Source (fromText, toText) import qualified Source.Span as Source @@ -50,13 +52,13 @@ instance APIBridge Legacy.Position Source.Pos where instance APIBridge API.Position Source.Pos where bridging = iso fromAPI toAPI where - toAPI Source.Pos{..} = API.Position (fromIntegral line) (fromIntegral column) - fromAPI API.Position{..} = Source.Pos (fromIntegral line) (fromIntegral column) + toAPI Source.Pos{..} = defMessage & P.line .~ fromIntegral line & P.column .~ fromIntegral column + fromAPI position = Source.Pos (fromIntegral (position^.line)) (fromIntegral (position^.column)) instance APIConvert API.Span Source.Span where converting = prism' toAPI fromAPI where - toAPI Source.Span{..} = API.Span (bridging #? start) (bridging #? end) - fromAPI API.Span{..} = Source.Span <$> (start >>= preview bridging) <*> (end >>= preview bridging) + toAPI Source.Span{..} = defMessage & P.maybe'start .~ (bridging #? start) & P.maybe'end .~ (bridging #? end) + fromAPI span = Source.Span <$> (span^.maybe'start >>= preview bridging) <*> (span^.maybe'end >>= preview bridging) instance APIConvert Legacy.Span Source.Span where converting = prism' toAPI fromAPI where @@ -68,18 +70,19 @@ instance APIBridge T.Text Data.Language where instance APIBridge API.Blob Data.Blob where bridging = iso apiBlobToBlob blobToApiBlob where - blobToApiBlob b = API.Blob (toText (Data.blobSource b)) (T.pack (Data.blobPath b)) (bridging # Data.blobLanguage b) - apiBlobToBlob API.Blob{..} = Data.makeBlob (fromText content) (T.unpack path) (language ^. bridging) mempty + blobToApiBlob b = defMessage & P.content .~ toText (Data.blobSource b) & P.path .~ T.pack (Data.blobPath b) & P.language .~ (bridging # Data.blobLanguage b) + apiBlobToBlob blob = Data.makeBlob (fromText (blob^.content)) (T.unpack (blob^.path)) (blob^.(language . bridging)) mempty instance APIConvert API.BlobPair Data.BlobPair where converting = prism' blobPairToApiBlobPair apiBlobPairToBlobPair where - apiBlobPairToBlobPair (API.BlobPair (Just before) (Just after)) = Just $ Data.Diffing (before^.bridging) (after^.bridging) - apiBlobPairToBlobPair (API.BlobPair (Just before) Nothing) = Just $ Data.Deleting (before^.bridging) - apiBlobPairToBlobPair (API.BlobPair Nothing (Just after)) = Just $ Data.Inserting (after^.bridging) - apiBlobPairToBlobPair _ = Nothing + apiBlobPairToBlobPair blobPair = case (blobPair^.maybe'before, blobPair^.maybe'after) of + (Just before, Just after) -> Just $ Data.Diffing (before^.bridging) (after^.bridging) + (Just before, Nothing) -> Just $ Data.Deleting (before^.bridging) + (Nothing, Just after) -> Just $ Data.Inserting (after^.bridging) + _ -> Nothing - blobPairToApiBlobPair (Data.Diffing before after) = API.BlobPair (bridging #? before) (bridging #? after) - blobPairToApiBlobPair (Data.Inserting after) = API.BlobPair Nothing (bridging #? after) - blobPairToApiBlobPair (Data.Deleting before) = API.BlobPair (bridging #? before) Nothing + blobPairToApiBlobPair (Data.Diffing before after) = defMessage & P.maybe'before .~ (bridging #? before) & P.maybe'after .~ (bridging #? after) + blobPairToApiBlobPair (Data.Inserting after) = defMessage & P.maybe'before .~ Nothing & P.maybe'after .~ (bridging #? after) + blobPairToApiBlobPair (Data.Deleting before) = defMessage & P.maybe'before .~ (bridging #? before) & P.maybe'after .~ Nothing diff --git a/src/Semantic/Api/Diffs.hs b/src/Semantic/Api/Diffs.hs index 823e6ce5ac..e34018643b 100644 --- a/src/Semantic/Api/Diffs.hs +++ b/src/Semantic/Api/Diffs.hs @@ -23,23 +23,25 @@ import Data.Diff import Data.Graph import Data.JSON.Fields import Data.Language +import Data.ProtoLens (defMessage) import Data.Term import qualified Data.Text as T -import qualified Data.Vector as V import Diffing.Algorithm (Diffable) import Parsing.Parser import Prologue +import Proto.Semantic as P hiding (Blob, BlobPair) +import Proto.Semantic_Fields as P import Rendering.Graph import Rendering.JSON hiding (JSON) import qualified Rendering.JSON import Semantic.Api.Bridge -import Semantic.Proto.SemanticPB hiding (Blob, BlobPair) import Semantic.Task as Task import Semantic.Telemetry as Stat import Serializing.Format hiding (JSON) import qualified Serializing.Format as Format import Source.Loc + data DiffOutputFormat = DiffJSONTree | DiffJSONGraph @@ -50,7 +52,7 @@ data DiffOutputFormat parseDiffBuilder :: (Traversable t, DiffEffects sig m) => DiffOutputFormat -> t BlobPair -> m Builder parseDiffBuilder DiffJSONTree = distributeFoldMap (jsonDiff renderJSONTree) >=> serialize Format.JSON -- NB: Serialize happens at the top level for these two JSON formats to collect results of multiple blob pairs. -parseDiffBuilder DiffJSONGraph = diffGraph >=> serialize Format.JSON +parseDiffBuilder DiffJSONGraph = diffGraph >=> serialize Format.JSONPB parseDiffBuilder DiffSExpression = distributeFoldMap sexpDiff parseDiffBuilder DiffShow = distributeFoldMap showDiff parseDiffBuilder DiffDotGraph = distributeFoldMap dotGraphDiff @@ -67,12 +69,20 @@ renderJSONTree :: (Applicative m, ToJSONFields1 syntax) => BlobPair -> Diff synt renderJSONTree blobPair = pure . renderJSONDiff blobPair diffGraph :: (Traversable t, DiffEffects sig m) => t BlobPair -> m DiffTreeGraphResponse -diffGraph blobs = DiffTreeGraphResponse . V.fromList . toList <$> distributeFor blobs go +-- diffGraph blobs = DiffTreeGraphResponse . V.fromList . toList <$> distributeFor blobs go +diffGraph blobs = do + graph <- distributeFor blobs go + pure $ defMessage & P.files .~ toList graph where go :: (DiffEffects sig m) => BlobPair -> m DiffTreeFileGraph go blobPair = doDiff blobPair (const pure) render `catchError` \(SomeException e) -> - pure (DiffTreeFileGraph path lang mempty mempty (V.fromList [ParseError (T.pack (show e))])) + pure $ defMessage + & P.path .~ path + & P.language .~ lang + & P.vertices .~ mempty + & P.edges .~ mempty + & P.errors .~ [defMessage & P.error .~ T.pack (show e)] where path = T.pack $ pathForBlobPair blobPair lang = bridging # languageForBlobPair blobPair @@ -80,8 +90,13 @@ diffGraph blobs = DiffTreeGraphResponse . V.fromList . toList <$> distributeFor render :: (Foldable syntax, Functor syntax, ConstructorName syntax, Applicative m) => BlobPair -> Diff syntax Loc Loc -> m DiffTreeFileGraph render _ diff = let graph = renderTreeGraph diff - toEdge (Edge (a, b)) = DiffTreeEdge (diffVertexId a) (diffVertexId b) - in pure $ DiffTreeFileGraph path lang (V.fromList (vertexList graph)) (V.fromList (fmap toEdge (edgeList graph))) mempty + toEdge (Edge (a, b)) = defMessage & P.source .~ a^.diffVertexId & P.target .~ b^.diffVertexId + in pure $ defMessage + & P.path .~ path + & P.language .~ lang + & P.vertices .~ vertexList graph + & P.edges .~ fmap toEdge (edgeList graph) + & P.errors .~ mempty sexpDiff :: (DiffEffects sig m) => BlobPair -> m Builder diff --git a/src/Semantic/Api/Symbols.hs b/src/Semantic/Api/Symbols.hs index 206f12ff02..7f36812d65 100644 --- a/src/Semantic/Api/Symbols.hs +++ b/src/Semantic/Api/Symbols.hs @@ -7,26 +7,28 @@ module Semantic.Api.Symbols import Control.Effect.Error import Control.Exception -import Control.Lens import Data.Blob hiding (File (..)) import Data.ByteString.Builder import Data.Maybe import Data.Term import qualified Data.Text as T -import qualified Data.Vector as V import Data.Text (pack) import Parsing.Parser import Prologue import Semantic.Api.Bridge import qualified Semantic.Api.LegacyTypes as Legacy import Semantic.Api.Terms (ParseEffects, doParse) -import Semantic.Proto.SemanticPB hiding (Blob) import Semantic.Task import Serializing.Format import Source.Loc import Tags.Taggable import Tags.Tagging +import Control.Lens +import Data.ProtoLens (defMessage) +import Proto.Semantic as P hiding (Blob) +import Proto.Semantic_Fields as P + legacyParseSymbols :: (Member Distribute sig, ParseEffects sig m, Traversable t) => t Blob -> m Legacy.ParseTreeSymbolResponse legacyParseSymbols blobs = Legacy.ParseTreeSymbolResponse <$> distributeFoldMap go blobs where @@ -58,14 +60,21 @@ parseSymbolsBuilder :: (Member Distribute sig, ParseEffects sig m, Traversable t parseSymbolsBuilder format blobs = parseSymbols blobs >>= serialize format parseSymbols :: (Member Distribute sig, ParseEffects sig m, Traversable t) => t Blob -> m ParseTreeSymbolResponse -parseSymbols blobs = ParseTreeSymbolResponse . V.fromList . toList <$> distributeFor blobs go +parseSymbols blobs = do -- ParseTreeSymbolResponse . V.fromList . toList <$> distributeFor blobs go + terms <- distributeFor blobs go + pure $ defMessage & P.files .~ toList terms where go :: (Member (Error SomeException) sig, Member Task sig, Carrier sig m) => Blob -> m File go blob@Blob{..} = (doParse blob >>= withSomeTerm renderToSymbols) `catchError` (\(SomeException e) -> pure $ errorFile (show e)) where blobLanguage' = blobLanguage blob blobPath' = pack $ blobPath blob - errorFile e = File blobPath' (bridging # blobLanguage blob) mempty (V.fromList [ParseError (T.pack e)]) blobOid + errorFile e = defMessage + & P.path .~ blobPath' + & P.language .~ (bridging # blobLanguage blob) + & P.symbols .~ mempty + & P.errors .~ [defMessage & P.error .~ T.pack e] + & P.blobOid .~ blobOid symbolsToSummarize :: [Text] symbolsToSummarize = ["Function", "Method", "Class", "Module", "Call", "Send"] @@ -74,14 +83,19 @@ parseSymbols blobs = ParseTreeSymbolResponse . V.fromList . toList <$> distribut renderToSymbols term = pure $ tagsToFile (runTagging blob symbolsToSummarize term) tagsToFile :: [Tag] -> File - tagsToFile tags = File blobPath' (bridging # blobLanguage') (V.fromList (fmap tagToSymbol tags)) mempty blobOid + tagsToFile tags = defMessage + & P.path .~ blobPath' + & P.language .~ (bridging # blobLanguage') + & P.symbols .~ fmap tagToSymbol tags + & P.errors .~ mempty + & P.blobOid .~ blobOid tagToSymbol :: Tag -> Symbol - tagToSymbol Tag{..} - = Symbol - { symbol = name - , kind = kind - , line = fromMaybe mempty line - , span = converting #? span - , docs = fmap Docstring docs - } + tagToSymbol Tag{..} = defMessage + & P.symbol .~ name + & P.kind .~ kind + & P.line .~ fromMaybe mempty line + & P.maybe'span .~ converting #? span + & P.maybe'docs .~ case docs of + Just d -> Just (defMessage & P.docstring .~ d) + Nothing -> Nothing diff --git a/src/Semantic/Api/TOCSummaries.hs b/src/Semantic/Api/TOCSummaries.hs index 87e7d6f82f..3a8befe51f 100644 --- a/src/Semantic/Api/TOCSummaries.hs +++ b/src/Semantic/Api/TOCSummaries.hs @@ -3,22 +3,24 @@ module Semantic.Api.TOCSummaries (diffSummary, legacyDiffSummary, diffSummaryBui import Analysis.TOCSummary (Declaration, declarationAlgebra) import Control.Effect.Error -import Control.Lens import Data.Aeson import Data.Blob import Data.ByteString.Builder import Data.Diff import qualified Data.Map.Monoidal as Map import qualified Data.Text as T -import qualified Data.Vector as V import Data.Semilattice.Lower import Rendering.TOC import Semantic.Api.Diffs import Semantic.Api.Bridge -import Semantic.Proto.SemanticPB hiding (Blob, BlobPair) import Semantic.Task as Task import Serializing.Format +import Control.Lens +import Data.ProtoLens (defMessage) +import Proto.Semantic as P hiding (Blob, BlobPair) +import Proto.Semantic_Fields as P + diffSummaryBuilder :: (DiffEffects sig m) => Format DiffTreeTOCResponse -> [BlobPair] -> m Builder diffSummaryBuilder format blobs = diffSummary blobs >>= serialize format @@ -36,29 +38,42 @@ legacyDiffSummary = distributeFoldMap go render blobPair = pure . renderToCDiff blobPair diffSummary :: (DiffEffects sig m) => [BlobPair] -> m DiffTreeTOCResponse -diffSummary blobs = DiffTreeTOCResponse . V.fromList <$> distributeFor blobs go +diffSummary blobs = do + diff <- distributeFor blobs go + pure $ defMessage & P.files .~ diff where go :: (DiffEffects sig m) => BlobPair -> m TOCSummaryFile go blobPair = doDiff blobPair (decorate . declarationAlgebra) render `catchError` \(SomeException e) -> - pure $ TOCSummaryFile path lang mempty (V.fromList [TOCSummaryError (T.pack (show e)) Nothing]) + pure $ defMessage + & P.path .~ path + & P.language .~ lang + & P.changes .~ mempty + & P.errors .~ [defMessage & P.error .~ T.pack (show e) & P.maybe'span .~ Nothing] where path = T.pack $ pathKeyForBlobPair blobPair lang = bridging # languageForBlobPair blobPair render :: (Foldable syntax, Functor syntax, Applicative m) => BlobPair -> Diff syntax (Maybe Declaration) (Maybe Declaration) -> m TOCSummaryFile - render blobPair diff = pure $ foldr go (TOCSummaryFile path lang mempty mempty) (diffTOC diff) + render blobPair diff = pure $ foldr go (defMessage & P.path .~ path & P.language .~ lang & P.changes .~ mempty & P.errors .~ mempty) (diffTOC diff) where path = T.pack $ pathKeyForBlobPair blobPair lang = bridging # languageForBlobPair blobPair toChangeType = \case - "added" -> Added - "modified" -> Modified - "removed" -> Removed - _ -> None + "added" -> ADDED + "modified" -> MODIFIED + "removed" -> REMOVED + _ -> NONE go :: TOCSummary -> TOCSummaryFile -> TOCSummaryFile - go TOCSummary{..} TOCSummaryFile{..} - = TOCSummaryFile path language (V.cons (TOCSummaryChange summaryCategoryName summaryTermName (converting #? summarySpan) (toChangeType summaryChangeType)) changes) errors - go ErrorSummary{..} TOCSummaryFile{..} - = TOCSummaryFile path language changes (V.cons (TOCSummaryError errorText (converting #? errorSpan)) errors) + go TOCSummary{..} file = defMessage + & P.path .~ file^.P.path + & P.language .~ file^.P.language + & P.changes .~ (defMessage & P.category .~ summaryCategoryName & P.term .~ summaryTermName & P.maybe'span .~ (converting #? summarySpan) & P.changeType .~ toChangeType summaryChangeType) : file^.P.changes + & P.errors .~ file^.P.errors + + go ErrorSummary{..} file = defMessage + & P.path .~ file^.P.path + & P.language .~ file^.P.language + & P.changes .~ file^.P.changes + & P.errors .~ (defMessage & P.error .~ errorText & P.maybe'span .~ converting #? errorSpan) : file^.P.errors diff --git a/src/Semantic/Api/Terms.hs b/src/Semantic/Api/Terms.hs index 9ae71df521..a73c5d5011 100644 --- a/src/Semantic/Api/Terms.hs +++ b/src/Semantic/Api/Terms.hs @@ -16,7 +16,6 @@ module Semantic.Api.Terms import Analysis.ConstructorName (ConstructorName) import Control.Effect.Error -import Control.Lens import Control.Monad import Control.Monad.IO.Class import Data.Abstract.Declarations @@ -29,35 +28,51 @@ import Data.Language import Data.Quieterm import Data.Term import qualified Data.Text as T -import qualified Data.Vector as V import Parsing.Parser import Prologue import Rendering.Graph import Rendering.JSON hiding (JSON) import qualified Rendering.JSON import Semantic.Api.Bridge -import Semantic.Proto.SemanticPB hiding (Blob) import Semantic.Task import Serializing.Format hiding (JSON) import qualified Serializing.Format as Format import Source.Loc import Tags.Taggable +import Control.Lens +import Data.ProtoLens (defMessage) +import Proto.Semantic as P hiding (Blob) +import Proto.Semantic_Fields as P + termGraph :: (Traversable t, Member Distribute sig, ParseEffects sig m) => t Blob -> m ParseTreeGraphResponse -termGraph blobs = ParseTreeGraphResponse . V.fromList . toList <$> distributeFor blobs go +termGraph blobs = do + terms <- distributeFor blobs go + pure $ defMessage + & P.files .~ toList terms where go :: ParseEffects sig m => Blob -> m ParseTreeFileGraph go blob = (doParse blob >>= withSomeTerm (pure . render)) `catchError` \(SomeException e) -> - pure (ParseTreeFileGraph path lang mempty mempty (V.fromList [ParseError (T.pack (show e))])) + pure $ defMessage + & P.path .~ path + & P.language .~ lang + & P.vertices .~ mempty + & P.edges .~ mempty + & P.errors .~ [defMessage & P.error .~ T.pack (show e)] where path = T.pack $ blobPath blob lang = bridging # blobLanguage blob render :: (Foldable syntax, Functor syntax, ConstructorName syntax) => Term syntax Loc -> ParseTreeFileGraph render t = let graph = renderTreeGraph t - toEdge (Edge (a, b)) = TermEdge (vertexId a) (vertexId b) - in ParseTreeFileGraph path lang (V.fromList (vertexList graph)) (V.fromList (fmap toEdge (edgeList graph))) mempty + toEdge (Edge (a, b)) = defMessage & P.source .~ a^.vertexId & P.target .~ b^.vertexId + in defMessage + & P.path .~ path + & P.language .~ lang + & P.vertices .~ vertexList graph + & P.edges .~ fmap toEdge (edgeList graph) + & P.errors .~ mempty data TermOutputFormat = TermJSONTree @@ -71,7 +86,7 @@ data TermOutputFormat parseTermBuilder :: (Traversable t, Member Distribute sig, ParseEffects sig m, MonadIO m) => TermOutputFormat-> t Blob -> m Builder parseTermBuilder TermJSONTree = distributeFoldMap jsonTerm >=> serialize Format.JSON -- NB: Serialize happens at the top level for these two JSON formats to collect results of multiple blobs. -parseTermBuilder TermJSONGraph = termGraph >=> serialize Format.JSON +parseTermBuilder TermJSONGraph = termGraph >=> serialize Format.JSONPB parseTermBuilder TermSExpression = distributeFoldMap sexpTerm parseTermBuilder TermDotGraph = distributeFoldMap dotGraphTerm parseTermBuilder TermShow = distributeFoldMap showTerm diff --git a/src/Semantic/CLI.hs b/src/Semantic/CLI.hs index a0b98de49e..ea8f6b78d7 100644 --- a/src/Semantic/CLI.hs +++ b/src/Semantic/CLI.hs @@ -91,7 +91,7 @@ diffCommand = command "diff" (info diffArgumentsParser (progDesc "Compute change renderer <- flag (parseDiffBuilder DiffSExpression) (parseDiffBuilder DiffSExpression) (long "sexpression" <> help "Output s-expression diff tree (default)") <|> flag' (parseDiffBuilder DiffJSONTree) (long "json" <> help "Output JSON diff trees") <|> flag' (parseDiffBuilder DiffJSONGraph) (long "json-graph" <> help "Output JSON diff trees") - <|> flag' (diffSummaryBuilder JSON) (long "toc" <> help "Output JSON table of contents diff summary") + <|> flag' (diffSummaryBuilder JSONPB) (long "toc" <> help "Output JSON table of contents diff summary") <|> flag' (parseDiffBuilder DiffDotGraph) (long "dot" <> help "Output the diff as a DOT graph") <|> flag' (parseDiffBuilder DiffShow) (long "show" <> help "Output using the Show instance (debug only, format subject to change without notice)") filesOrStdin <- Right <$> some (Both <$> argument filePathReader (metavar "FILE_A") <*> argument filePathReader (metavar "FILE_B")) <|> pure (Left stdin) @@ -104,8 +104,8 @@ parseCommand = command "parse" (info parseArgumentsParser (progDesc "Generate pa renderer <- flag (parseTermBuilder TermSExpression) (parseTermBuilder TermSExpression) (long "sexpression" <> help "Output s-expression parse trees (default)") <|> flag' (parseTermBuilder TermJSONTree) (long "json" <> help "Output JSON parse trees") <|> flag' (parseTermBuilder TermJSONGraph) (long "json-graph" <> help "Output JSON adjacency list") - <|> flag' (parseSymbolsBuilder JSON) (long "symbols" <> help "Output JSON symbol list") - <|> flag' (parseSymbolsBuilder JSON) (long "json-symbols" <> help "Output JSON symbol list") + <|> flag' (parseSymbolsBuilder JSONPB) (long "symbols" <> help "Output JSON symbol list") + <|> flag' (parseSymbolsBuilder JSONPB) (long "json-symbols" <> help "Output JSON symbol list") <|> flag' (parseSymbolsBuilder Proto) (long "proto-symbols" <> help "Output JSON symbol list") <|> flag' (parseTermBuilder TermDotGraph) (long "dot" <> help "Output DOT graph parse trees") <|> flag' (parseTermBuilder TermShow) (long "show" <> help "Output using the Show instance (debug only, format subject to change without notice)") diff --git a/src/Serializing/Format.hs b/src/Serializing/Format.hs index 8cbaa2157d..c80860cb9c 100644 --- a/src/Serializing/Format.hs +++ b/src/Serializing/Format.hs @@ -14,13 +14,16 @@ import Data.ByteString.Builder import Language.Haskell.HsColour import Language.Haskell.HsColour.Colourise import Prologue -import Proto3.Suite as Proto3 +import Data.ProtoLens.Encoding as Proto +import Data.ProtoLens.JSON as Proto (messageToEncoding) +import Data.ProtoLens.Message (Message) import Serializing.SExpression import Text.Show.Pretty data Format input where DOT :: (Ord vertex, ToGraph graph, ToVertex graph ~ vertex) => Style vertex Builder -> Format graph JSON :: ToJSON input => Format input + JSONPB :: Message input => Format input SExpression :: (Recursive input, ToSExpression (Base input)) => Options -> Format input Show :: Show input => Format input Proto :: Message input => Format input @@ -33,4 +36,5 @@ runSerialize _ JSON = (<> "\n") . fromEncoding . toEncodin runSerialize _ (SExpression opts) = serializeSExpression opts runSerialize Colourful Show = (<> "\n") . stringUtf8 . hscolour TTY defaultColourPrefs False False "" False . ppShow runSerialize Plain Show = (<> "\n") . stringUtf8 . show -runSerialize _ Proto = lazyByteString . Proto3.toLazyByteString +runSerialize _ JSONPB = fromEncoding . Proto.messageToEncoding +runSerialize _ Proto = Proto.buildMessage -- lazyByteString . Proto3.toLazyByteString From 06a108aa032f2bddf7dbee2bc96c864fe77a0ba7 Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Mon, 30 Sep 2019 13:54:05 -0700 Subject: [PATCH 02/13] Already are using lens --- semantic.cabal | 1 - 1 file changed, 1 deletion(-) diff --git a/semantic.cabal b/semantic.cabal index 2e1d91fe9b..9b4b3089b2 100644 --- a/semantic.cabal +++ b/semantic.cabal @@ -71,7 +71,6 @@ common dependencies , text ^>= 1.2.3.1 , these >= 0.7 && <1 , unix ^>= 2.7.2.2 - , microlens , proto-lens == 0.4.0.1 , proto-lens-json == 0.3.0.0 , proto-lens-runtime == 0.4.0.2 From c0a53e957d36993437f91cd51be36a4520c5f9aa Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Mon, 30 Sep 2019 15:26:45 -0700 Subject: [PATCH 03/13] Bump to newer version of proto-lens --- Dockerfile | 14 +- script/protoc | 3 +- semantic.cabal | 4 +- src/Proto/Semantic.hs | 4804 +++++++++++++++++++++++++++------- src/Proto/Semantic_Fields.hs | 433 ++- src/Rendering/Graph.hs | 2 +- 6 files changed, 4090 insertions(+), 1170 deletions(-) diff --git a/Dockerfile b/Dockerfile index c3ad60447c..d368f704d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,10 @@ # Put protoc and twirp tooling in its own image -FROM golang:1.12-stretch AS protoc +FROM haskell:8.6 as haskell +RUN cabal new-update hackage.haskell.org,HEAD +RUN cabal new-install proto-lens-protoc +RUN which proto-lens-protoc + +FROM golang:1.13-stretch AS protoc RUN apt-get update && apt-get install -y unzip ENV PROTOBUF_VERSION=3.7.1 RUN wget "https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/protoc-$PROTOBUF_VERSION-linux-x86_64.zip" && \ @@ -7,10 +12,11 @@ RUN wget "https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/p RUN go get github.com/golang/protobuf/proto && \ go get github.com/twitchtv/protogen/typemap && \ - go get github.com/tclem/twirp-haskell/pkg/gen/haskell && \ - go get github.com/tclem/twirp-haskell/protoc-gen-haskell + GO111MODULE=on go get github.com/tclem/twirp-haskell/protoc-gen-twirp_haskell@proto-lens + +COPY --from=haskell /root/.cabal/bin/proto-lens-protoc /usr/local/bin/proto-lens-protoc -ENTRYPOINT ["/protobuf/bin/protoc", "-I/protobuf", "-I=/go/src/github.com/tclem/twirp-haskell"] +ENTRYPOINT ["/protobuf/bin/protoc", "-I/protobuf", "--plugin=protoc-gen-haskell=/usr/local/bin/proto-lens-protoc"] # Build semantic FROM haskell:8.6 as build diff --git a/script/protoc b/script/protoc index b4823415e1..0acc00cac3 100755 --- a/script/protoc +++ b/script/protoc @@ -14,6 +14,5 @@ export PROJECT="github.com/github/semantic" # Generate Haskell for semantic's protobuf types docker run --rm --user $(id -u):$(id -g) -v $(pwd):/go/src/$PROJECT -w /go/src/$PROJECT \ - semantic-protoc \ - --proto_path=proto --haskell_out=src/Semantic/Proto \ + semantic-protoc --proto_path=proto --haskell_out=./src \ semantic.proto diff --git a/semantic.cabal b/semantic.cabal index 9b4b3089b2..337c732144 100644 --- a/semantic.cabal +++ b/semantic.cabal @@ -71,9 +71,9 @@ common dependencies , text ^>= 1.2.3.1 , these >= 0.7 && <1 , unix ^>= 2.7.2.2 - , proto-lens == 0.4.0.1 + , proto-lens == 0.5.1.0 , proto-lens-json == 0.3.0.0 - , proto-lens-runtime == 0.4.0.2 + , proto-lens-runtime == 0.5.0.0 , lingo >= 0.2.0.0 common executable-flags diff --git a/src/Proto/Semantic.hs b/src/Proto/Semantic.hs index 614cef6f0f..c2f1e9b8ca 100644 --- a/src/Proto/Semantic.hs +++ b/src/Proto/Semantic.hs @@ -2,7 +2,8 @@ {-# LANGUAGE ScopedTypeVariables, DataKinds, TypeFamilies, UndecidableInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses, FlexibleContexts, FlexibleInstances, - PatternSynonyms, MagicHash, NoImplicitPrelude, DataKinds #-} + PatternSynonyms, MagicHash, NoImplicitPrelude, DataKinds, + BangPatterns, TypeApplications #-} {-# OPTIONS_GHC -fno-warn-unused-imports#-} {-# OPTIONS_GHC -fno-warn-duplicate-exports#-} module Proto.Semantic @@ -21,13 +22,28 @@ module Proto.Semantic where import qualified Data.ProtoLens.Runtime.Control.DeepSeq as Control.DeepSeq -import qualified Data.ProtoLens.Runtime.Lens.Labels.Prism - as Lens.Labels.Prism +import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Prism + as Data.ProtoLens.Prism import qualified Data.ProtoLens.Runtime.Prelude as Prelude import qualified Data.ProtoLens.Runtime.Data.Int as Data.Int +import qualified Data.ProtoLens.Runtime.Data.Monoid as Data.Monoid import qualified Data.ProtoLens.Runtime.Data.Word as Data.Word import qualified Data.ProtoLens.Runtime.Data.ProtoLens as Data.ProtoLens +import qualified + Data.ProtoLens.Runtime.Data.ProtoLens.Encoding.Bytes + as Data.ProtoLens.Encoding.Bytes +import qualified + Data.ProtoLens.Runtime.Data.ProtoLens.Encoding.Growing + as Data.ProtoLens.Encoding.Growing +import qualified + Data.ProtoLens.Runtime.Data.ProtoLens.Encoding.Parser.Unsafe + as Data.ProtoLens.Encoding.Parser.Unsafe +import qualified + Data.ProtoLens.Runtime.Data.ProtoLens.Encoding.Wire + as Data.ProtoLens.Encoding.Wire +import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Field + as Data.ProtoLens.Field import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Message.Enum as Data.ProtoLens.Message.Enum import qualified @@ -43,7 +59,13 @@ import qualified Data.ProtoLens.Runtime.Data.ByteString as Data.ByteString import qualified Data.ProtoLens.Runtime.Data.ByteString.Char8 as Data.ByteString.Char8 -import qualified Data.ProtoLens.Runtime.Lens.Labels as Lens.Labels +import qualified Data.ProtoLens.Runtime.Data.Text.Encoding + as Data.Text.Encoding +import qualified Data.ProtoLens.Runtime.Data.Vector as Data.Vector +import qualified Data.ProtoLens.Runtime.Data.Vector.Generic + as Data.Vector.Generic +import qualified Data.ProtoLens.Runtime.Data.Vector.Unboxed + as Data.Vector.Unboxed import qualified Data.ProtoLens.Runtime.Text.Read as Text.Read {- | Fields : @@ -61,25 +83,26 @@ instance Prelude.Show Blob where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' Blob "content" (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _Blob'content - (\ x__ y__ -> x__{_Blob'content = y__})) - Prelude.id -instance Lens.Labels.HasLens' Blob "path" (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _Blob'path - (\ x__ y__ -> x__{_Blob'path = y__})) - Prelude.id -instance Lens.Labels.HasLens' Blob "language" (Data.Text.Text) +instance Data.ProtoLens.Field.HasField Blob "content" + (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _Blob'language - (\ x__ y__ -> x__{_Blob'language = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _Blob'content + (\ x__ y__ -> x__{_Blob'content = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField Blob "path" (Data.Text.Text) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _Blob'path + (\ x__ y__ -> x__{_Blob'path = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField Blob "language" + (Data.Text.Text) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _Blob'language + (\ x__ y__ -> x__{_Blob'language = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message Blob where messageName _ = Data.Text.pack "github.semantic.Blob" fieldsByTag @@ -88,24 +111,21 @@ instance Data.ProtoLens.Message Blob where (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "content"))) + (Data.ProtoLens.Field.field @"content")) :: Data.ProtoLens.FieldDescriptor Blob path__field_descriptor = Data.ProtoLens.FieldDescriptor "path" (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "path"))) + (Data.ProtoLens.Field.field @"path")) :: Data.ProtoLens.FieldDescriptor Blob language__field_descriptor = Data.ProtoLens.FieldDescriptor "language" (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "language"))) + (Data.ProtoLens.Field.field @"language")) :: Data.ProtoLens.FieldDescriptor Blob in Data.Map.fromList @@ -120,13 +140,120 @@ instance Data.ProtoLens.Message Blob where _Blob'path = Data.ProtoLens.fieldDefault, _Blob'language = Data.ProtoLens.fieldDefault, _Blob'_unknownFields = ([])} + parseMessage + = let loop :: Blob -> Data.ProtoLens.Encoding.Bytes.Parser Blob + loop x + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + x) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 10 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "content" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"content") + y + x) + 18 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "path" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"path") y + x) + 26 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "language" + loop + (Lens.Family2.set + (Data.ProtoLens.Field.field @"language") + y + x) + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + in + (do loop Data.ProtoLens.defMessage) + Data.ProtoLens.Encoding.Bytes. "Blob" + buildMessage + = (\ _x -> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"content") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 10) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + (let _v = Lens.Family2.view (Data.ProtoLens.Field.field @"path") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 18) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"language") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 26) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData Blob where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_Blob'_unknownFields x__) - (Control.DeepSeq.deepseq (_Blob'content x__) - (Control.DeepSeq.deepseq (_Blob'path x__) - (Control.DeepSeq.deepseq (_Blob'language x__) (())))) + = (\ x__ -> + Control.DeepSeq.deepseq (_Blob'_unknownFields x__) + (Control.DeepSeq.deepseq (_Blob'content x__) + (Control.DeepSeq.deepseq (_Blob'path x__) + (Control.DeepSeq.deepseq (_Blob'language x__) (()))))) {- | Fields : * 'Proto.Semantic_Fields.before' @:: Lens' BlobPair Blob@ @@ -143,34 +270,32 @@ instance Prelude.Show BlobPair where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' BlobPair "before" (Blob) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _BlobPair'before - (\ x__ y__ -> x__{_BlobPair'before = y__})) - (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) -instance Lens.Labels.HasLens' BlobPair "maybe'before" +instance Data.ProtoLens.Field.HasField BlobPair "before" (Blob) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _BlobPair'before + (\ x__ y__ -> x__{_BlobPair'before = y__})) + Prelude.. Data.ProtoLens.maybeLens Data.ProtoLens.defMessage +instance Data.ProtoLens.Field.HasField BlobPair "maybe'before" (Prelude.Maybe Blob) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _BlobPair'before - (\ x__ y__ -> x__{_BlobPair'before = y__})) - Prelude.id -instance Lens.Labels.HasLens' BlobPair "after" (Blob) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _BlobPair'after - (\ x__ y__ -> x__{_BlobPair'after = y__})) - (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) -instance Lens.Labels.HasLens' BlobPair "maybe'after" + fieldOf _ + = (Lens.Family2.Unchecked.lens _BlobPair'before + (\ x__ y__ -> x__{_BlobPair'before = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField BlobPair "after" (Blob) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _BlobPair'after + (\ x__ y__ -> x__{_BlobPair'after = y__})) + Prelude.. Data.ProtoLens.maybeLens Data.ProtoLens.defMessage +instance Data.ProtoLens.Field.HasField BlobPair "maybe'after" (Prelude.Maybe Blob) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _BlobPair'after - (\ x__ y__ -> x__{_BlobPair'after = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _BlobPair'after + (\ x__ y__ -> x__{_BlobPair'after = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message BlobPair where messageName _ = Data.Text.pack "github.semantic.BlobPair" fieldsByTag @@ -179,16 +304,14 @@ instance Data.ProtoLens.Message BlobPair where (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor Blob) (Data.ProtoLens.OptionalField - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'before"))) + (Data.ProtoLens.Field.field @"maybe'before")) :: Data.ProtoLens.FieldDescriptor BlobPair after__field_descriptor = Data.ProtoLens.FieldDescriptor "after" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor Blob) (Data.ProtoLens.OptionalField - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'after"))) + (Data.ProtoLens.Field.field @"maybe'after")) :: Data.ProtoLens.FieldDescriptor BlobPair in Data.Map.fromList @@ -200,12 +323,88 @@ instance Data.ProtoLens.Message BlobPair where defMessage = BlobPair{_BlobPair'before = Prelude.Nothing, _BlobPair'after = Prelude.Nothing, _BlobPair'_unknownFields = ([])} + parseMessage + = let loop :: + BlobPair -> Data.ProtoLens.Encoding.Bytes.Parser BlobPair + loop x + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + x) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 10 -> do y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "before" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"before") + y + x) + 18 -> do y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "after" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"after") y + x) + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + in + (do loop Data.ProtoLens.defMessage) + Data.ProtoLens.Encoding.Bytes. "BlobPair" + buildMessage + = (\ _x -> + (case + Lens.Family2.view (Data.ProtoLens.Field.field @"maybe'before") _x + of + (Prelude.Nothing) -> Data.Monoid.mempty + Prelude.Just _v -> (Data.ProtoLens.Encoding.Bytes.putVarInt 10) + Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> + Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + Data.Monoid.<> + (case + Lens.Family2.view (Data.ProtoLens.Field.field @"maybe'after") _x of + (Prelude.Nothing) -> Data.Monoid.mempty + Prelude.Just _v -> (Data.ProtoLens.Encoding.Bytes.putVarInt 18) + Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral + (Data.ByteString.length bs))) + Data.Monoid.<> + Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData BlobPair where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_BlobPair'_unknownFields x__) - (Control.DeepSeq.deepseq (_BlobPair'before x__) - (Control.DeepSeq.deepseq (_BlobPair'after x__) (()))) + = (\ x__ -> + Control.DeepSeq.deepseq (_BlobPair'_unknownFields x__) + (Control.DeepSeq.deepseq (_BlobPair'before x__) + (Control.DeepSeq.deepseq (_BlobPair'after x__) (())))) newtype ChangeType'UnrecognizedValue = ChangeType'UnrecognizedValue Data.Int.Int32 deriving (Prelude.Eq, Prelude.Ord, Prelude.Show) data ChangeType = NONE @@ -230,12 +429,12 @@ instance Data.ProtoLens.MessageEnum ChangeType where showEnum (ChangeType'Unrecognized (ChangeType'UnrecognizedValue k)) = Prelude.show k readEnum k - | (Prelude.==) k "NONE" = Prelude.Just NONE - | (Prelude.==) k "ADDED" = Prelude.Just ADDED - | (Prelude.==) k "REMOVED" = Prelude.Just REMOVED - | (Prelude.==) k "MODIFIED" = Prelude.Just MODIFIED + | (k) Prelude.== "NONE" = Prelude.Just NONE + | (k) Prelude.== "ADDED" = Prelude.Just ADDED + | (k) Prelude.== "REMOVED" = Prelude.Just REMOVED + | (k) Prelude.== "MODIFIED" = Prelude.Just MODIFIED readEnum k - = (Prelude.>>=) (Text.Read.readMaybe k) Data.ProtoLens.maybeToEnum + = (Text.Read.readMaybe k) Prelude.>>= Data.ProtoLens.maybeToEnum instance Prelude.Bounded ChangeType where minBound = NONE maxBound = MODIFIED @@ -243,8 +442,8 @@ instance Prelude.Enum ChangeType where toEnum k__ = Prelude.maybe (Prelude.error - ((Prelude.++) "toEnum: unknown value for enum ChangeType: " - (Prelude.show k__))) + (("toEnum: unknown value for enum ChangeType: ") Prelude.++ + Prelude.show k__)) Prelude.id (Data.ProtoLens.maybeToEnum k__) fromEnum NONE = 0 @@ -293,27 +492,26 @@ instance Prelude.Show DeletedTerm where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' DeletedTerm "term" (Data.Text.Text) +instance Data.ProtoLens.Field.HasField DeletedTerm "term" + (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _DeletedTerm'term - (\ x__ y__ -> x__{_DeletedTerm'term = y__})) - Prelude.id -instance Lens.Labels.HasLens' DeletedTerm "span" (Span) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _DeletedTerm'span - (\ x__ y__ -> x__{_DeletedTerm'span = y__})) - (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) -instance Lens.Labels.HasLens' DeletedTerm "maybe'span" + fieldOf _ + = (Lens.Family2.Unchecked.lens _DeletedTerm'term + (\ x__ y__ -> x__{_DeletedTerm'term = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField DeletedTerm "span" (Span) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _DeletedTerm'span + (\ x__ y__ -> x__{_DeletedTerm'span = y__})) + Prelude.. Data.ProtoLens.maybeLens Data.ProtoLens.defMessage +instance Data.ProtoLens.Field.HasField DeletedTerm "maybe'span" (Prelude.Maybe Span) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _DeletedTerm'span - (\ x__ y__ -> x__{_DeletedTerm'span = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _DeletedTerm'span + (\ x__ y__ -> x__{_DeletedTerm'span = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message DeletedTerm where messageName _ = Data.Text.pack "github.semantic.DeletedTerm" fieldsByTag @@ -322,16 +520,14 @@ instance Data.ProtoLens.Message DeletedTerm where (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "term"))) + (Data.ProtoLens.Field.field @"term")) :: Data.ProtoLens.FieldDescriptor DeletedTerm span__field_descriptor = Data.ProtoLens.FieldDescriptor "span" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor Span) (Data.ProtoLens.OptionalField - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'span"))) + (Data.ProtoLens.Field.field @"maybe'span")) :: Data.ProtoLens.FieldDescriptor DeletedTerm in Data.Map.fromList @@ -344,12 +540,89 @@ instance Data.ProtoLens.Message DeletedTerm where = DeletedTerm{_DeletedTerm'term = Data.ProtoLens.fieldDefault, _DeletedTerm'span = Prelude.Nothing, _DeletedTerm'_unknownFields = ([])} + parseMessage + = let loop :: + DeletedTerm -> Data.ProtoLens.Encoding.Bytes.Parser DeletedTerm + loop x + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + x) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 10 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "term" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"term") y + x) + 18 -> do y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "span" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"span") y + x) + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + in + (do loop Data.ProtoLens.defMessage) + Data.ProtoLens.Encoding.Bytes. "DeletedTerm" + buildMessage + = (\ _x -> + (let _v = Lens.Family2.view (Data.ProtoLens.Field.field @"term") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 10) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + (case + Lens.Family2.view (Data.ProtoLens.Field.field @"maybe'span") _x of + (Prelude.Nothing) -> Data.Monoid.mempty + Prelude.Just _v -> (Data.ProtoLens.Encoding.Bytes.putVarInt 18) + Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral + (Data.ByteString.length bs))) + Data.Monoid.<> + Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData DeletedTerm where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_DeletedTerm'_unknownFields x__) - (Control.DeepSeq.deepseq (_DeletedTerm'term x__) - (Control.DeepSeq.deepseq (_DeletedTerm'span x__) (()))) + = (\ x__ -> + Control.DeepSeq.deepseq (_DeletedTerm'_unknownFields x__) + (Control.DeepSeq.deepseq (_DeletedTerm'term x__) + (Control.DeepSeq.deepseq (_DeletedTerm'span x__) (())))) {- | Fields : * 'Proto.Semantic_Fields.source' @:: Lens' DiffTreeEdge Data.Int.Int32@ @@ -365,22 +638,20 @@ instance Prelude.Show DiffTreeEdge where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' DiffTreeEdge "source" +instance Data.ProtoLens.Field.HasField DiffTreeEdge "source" (Data.Int.Int32) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _DiffTreeEdge'source - (\ x__ y__ -> x__{_DiffTreeEdge'source = y__})) - Prelude.id -instance Lens.Labels.HasLens' DiffTreeEdge "target" + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeEdge'source + (\ x__ y__ -> x__{_DiffTreeEdge'source = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField DiffTreeEdge "target" (Data.Int.Int32) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _DiffTreeEdge'target - (\ x__ y__ -> x__{_DiffTreeEdge'target = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeEdge'target + (\ x__ y__ -> x__{_DiffTreeEdge'target = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message DiffTreeEdge where messageName _ = Data.Text.pack "github.semantic.DiffTreeEdge" fieldsByTag @@ -389,16 +660,14 @@ instance Data.ProtoLens.Message DiffTreeEdge where (Data.ProtoLens.ScalarField Data.ProtoLens.Int32Field :: Data.ProtoLens.FieldTypeDescriptor Data.Int.Int32) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "source"))) + (Data.ProtoLens.Field.field @"source")) :: Data.ProtoLens.FieldDescriptor DiffTreeEdge target__field_descriptor = Data.ProtoLens.FieldDescriptor "target" (Data.ProtoLens.ScalarField Data.ProtoLens.Int32Field :: Data.ProtoLens.FieldTypeDescriptor Data.Int.Int32) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "target"))) + (Data.ProtoLens.Field.field @"target")) :: Data.ProtoLens.FieldDescriptor DiffTreeEdge in Data.Map.fromList @@ -411,26 +680,96 @@ instance Data.ProtoLens.Message DiffTreeEdge where = DiffTreeEdge{_DiffTreeEdge'source = Data.ProtoLens.fieldDefault, _DiffTreeEdge'target = Data.ProtoLens.fieldDefault, _DiffTreeEdge'_unknownFields = ([])} + parseMessage + = let loop :: + DiffTreeEdge -> Data.ProtoLens.Encoding.Bytes.Parser DiffTreeEdge + loop x + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + x) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 8 -> do y <- (Prelude.fmap Prelude.fromIntegral + Data.ProtoLens.Encoding.Bytes.getVarInt) + Data.ProtoLens.Encoding.Bytes. "source" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"source") y + x) + 16 -> do y <- (Prelude.fmap Prelude.fromIntegral + Data.ProtoLens.Encoding.Bytes.getVarInt) + Data.ProtoLens.Encoding.Bytes. "target" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"target") + y + x) + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + in + (do loop Data.ProtoLens.defMessage) + Data.ProtoLens.Encoding.Bytes. "DiffTreeEdge" + buildMessage + = (\ _x -> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"source") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 8) Data.Monoid.<> + ((Data.ProtoLens.Encoding.Bytes.putVarInt) Prelude.. + Prelude.fromIntegral) + _v) + Data.Monoid.<> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"target") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 16) Data.Monoid.<> + ((Data.ProtoLens.Encoding.Bytes.putVarInt) Prelude.. + Prelude.fromIntegral) + _v) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData DiffTreeEdge where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_DiffTreeEdge'_unknownFields x__) - (Control.DeepSeq.deepseq (_DiffTreeEdge'source x__) - (Control.DeepSeq.deepseq (_DiffTreeEdge'target x__) (()))) + = (\ x__ -> + Control.DeepSeq.deepseq (_DiffTreeEdge'_unknownFields x__) + (Control.DeepSeq.deepseq (_DiffTreeEdge'source x__) + (Control.DeepSeq.deepseq (_DiffTreeEdge'target x__) (())))) {- | Fields : * 'Proto.Semantic_Fields.path' @:: Lens' DiffTreeFileGraph Data.Text.Text@ * 'Proto.Semantic_Fields.language' @:: Lens' DiffTreeFileGraph Data.Text.Text@ * 'Proto.Semantic_Fields.vertices' @:: Lens' DiffTreeFileGraph [DiffTreeVertex]@ + * 'Proto.Semantic_Fields.vec'vertices' @:: Lens' DiffTreeFileGraph (Data.Vector.Vector DiffTreeVertex)@ * 'Proto.Semantic_Fields.edges' @:: Lens' DiffTreeFileGraph [DiffTreeEdge]@ + * 'Proto.Semantic_Fields.vec'edges' @:: Lens' DiffTreeFileGraph (Data.Vector.Vector DiffTreeEdge)@ * 'Proto.Semantic_Fields.errors' @:: Lens' DiffTreeFileGraph [ParseError]@ + * 'Proto.Semantic_Fields.vec'errors' @:: Lens' DiffTreeFileGraph (Data.Vector.Vector ParseError)@ -} data DiffTreeFileGraph = DiffTreeFileGraph{_DiffTreeFileGraph'path :: !Data.Text.Text, _DiffTreeFileGraph'language :: !Data.Text.Text, - _DiffTreeFileGraph'vertices :: ![DiffTreeVertex], - _DiffTreeFileGraph'edges :: ![DiffTreeEdge], - _DiffTreeFileGraph'errors :: ![ParseError], + _DiffTreeFileGraph'vertices :: + !(Data.Vector.Vector DiffTreeVertex), + _DiffTreeFileGraph'edges :: + !(Data.Vector.Vector DiffTreeEdge), + _DiffTreeFileGraph'errors :: + !(Data.Vector.Vector ParseError), _DiffTreeFileGraph'_unknownFields :: !Data.ProtoLens.FieldSet} deriving (Prelude.Eq, Prelude.Ord) @@ -439,46 +778,71 @@ instance Prelude.Show DiffTreeFileGraph where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' DiffTreeFileGraph "path" +instance Data.ProtoLens.Field.HasField DiffTreeFileGraph "path" (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _DiffTreeFileGraph'path - (\ x__ y__ -> x__{_DiffTreeFileGraph'path = y__})) - Prelude.id -instance Lens.Labels.HasLens' DiffTreeFileGraph "language" + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeFileGraph'path + (\ x__ y__ -> x__{_DiffTreeFileGraph'path = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField DiffTreeFileGraph "language" (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _DiffTreeFileGraph'language - (\ x__ y__ -> x__{_DiffTreeFileGraph'language = y__})) - Prelude.id -instance Lens.Labels.HasLens' DiffTreeFileGraph "vertices" + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeFileGraph'language + (\ x__ y__ -> x__{_DiffTreeFileGraph'language = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField DiffTreeFileGraph "vertices" ([DiffTreeVertex]) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _DiffTreeFileGraph'vertices - (\ x__ y__ -> x__{_DiffTreeFileGraph'vertices = y__})) - Prelude.id -instance Lens.Labels.HasLens' DiffTreeFileGraph "edges" + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeFileGraph'vertices + (\ x__ y__ -> x__{_DiffTreeFileGraph'vertices = y__})) + Prelude.. + Lens.Family2.Unchecked.lens Data.Vector.Generic.toList + (\ _ y__ -> Data.Vector.Generic.fromList y__) +instance Data.ProtoLens.Field.HasField DiffTreeFileGraph + "vec'vertices" + (Data.Vector.Vector DiffTreeVertex) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeFileGraph'vertices + (\ x__ y__ -> x__{_DiffTreeFileGraph'vertices = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField DiffTreeFileGraph "edges" ([DiffTreeEdge]) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _DiffTreeFileGraph'edges - (\ x__ y__ -> x__{_DiffTreeFileGraph'edges = y__})) - Prelude.id -instance Lens.Labels.HasLens' DiffTreeFileGraph "errors" + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeFileGraph'edges + (\ x__ y__ -> x__{_DiffTreeFileGraph'edges = y__})) + Prelude.. + Lens.Family2.Unchecked.lens Data.Vector.Generic.toList + (\ _ y__ -> Data.Vector.Generic.fromList y__) +instance Data.ProtoLens.Field.HasField DiffTreeFileGraph + "vec'edges" + (Data.Vector.Vector DiffTreeEdge) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeFileGraph'edges + (\ x__ y__ -> x__{_DiffTreeFileGraph'edges = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField DiffTreeFileGraph "errors" ([ParseError]) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _DiffTreeFileGraph'errors - (\ x__ y__ -> x__{_DiffTreeFileGraph'errors = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeFileGraph'errors + (\ x__ y__ -> x__{_DiffTreeFileGraph'errors = y__})) + Prelude.. + Lens.Family2.Unchecked.lens Data.Vector.Generic.toList + (\ _ y__ -> Data.Vector.Generic.fromList y__) +instance Data.ProtoLens.Field.HasField DiffTreeFileGraph + "vec'errors" + (Data.Vector.Vector ParseError) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeFileGraph'errors + (\ x__ y__ -> x__{_DiffTreeFileGraph'errors = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message DiffTreeFileGraph where messageName _ = Data.Text.pack "github.semantic.DiffTreeFileGraph" fieldsByTag @@ -487,40 +851,35 @@ instance Data.ProtoLens.Message DiffTreeFileGraph where (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "path"))) + (Data.ProtoLens.Field.field @"path")) :: Data.ProtoLens.FieldDescriptor DiffTreeFileGraph language__field_descriptor = Data.ProtoLens.FieldDescriptor "language" (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "language"))) + (Data.ProtoLens.Field.field @"language")) :: Data.ProtoLens.FieldDescriptor DiffTreeFileGraph vertices__field_descriptor = Data.ProtoLens.FieldDescriptor "vertices" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor DiffTreeVertex) (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "vertices"))) + (Data.ProtoLens.Field.field @"vertices")) :: Data.ProtoLens.FieldDescriptor DiffTreeFileGraph edges__field_descriptor = Data.ProtoLens.FieldDescriptor "edges" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor DiffTreeEdge) (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "edges"))) + (Data.ProtoLens.Field.field @"edges")) :: Data.ProtoLens.FieldDescriptor DiffTreeFileGraph errors__field_descriptor = Data.ProtoLens.FieldDescriptor "errors" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor ParseError) (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "errors"))) + (Data.ProtoLens.Field.field @"errors")) :: Data.ProtoLens.FieldDescriptor DiffTreeFileGraph in Data.Map.fromList @@ -536,24 +895,216 @@ instance Data.ProtoLens.Message DiffTreeFileGraph where = DiffTreeFileGraph{_DiffTreeFileGraph'path = Data.ProtoLens.fieldDefault, _DiffTreeFileGraph'language = Data.ProtoLens.fieldDefault, - _DiffTreeFileGraph'vertices = [], _DiffTreeFileGraph'edges = [], - _DiffTreeFileGraph'errors = [], + _DiffTreeFileGraph'vertices = Data.Vector.Generic.empty, + _DiffTreeFileGraph'edges = Data.Vector.Generic.empty, + _DiffTreeFileGraph'errors = Data.Vector.Generic.empty, _DiffTreeFileGraph'_unknownFields = ([])} + parseMessage + = let loop :: + DiffTreeFileGraph -> + Data.ProtoLens.Encoding.Growing.Growing Data.Vector.Vector + Data.ProtoLens.Encoding.Growing.RealWorld + DiffTreeEdge + -> + Data.ProtoLens.Encoding.Growing.Growing Data.Vector.Vector + Data.ProtoLens.Encoding.Growing.RealWorld + ParseError + -> + Data.ProtoLens.Encoding.Growing.Growing Data.Vector.Vector + Data.ProtoLens.Encoding.Growing.RealWorld + DiffTreeVertex + -> Data.ProtoLens.Encoding.Bytes.Parser DiffTreeFileGraph + loop x mutable'edges mutable'errors mutable'vertices + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do frozen'edges <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.unsafeFreeze + mutable'edges) + frozen'errors <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.unsafeFreeze + mutable'errors) + frozen'vertices <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.unsafeFreeze + mutable'vertices) + let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + (Lens.Family2.set (Data.ProtoLens.Field.field @"vec'edges") + frozen'edges + (Lens.Family2.set (Data.ProtoLens.Field.field @"vec'errors") + frozen'errors + (Lens.Family2.set + (Data.ProtoLens.Field.field @"vec'vertices") + frozen'vertices + x)))) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 10 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "path" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"path") y + x) + mutable'edges + mutable'errors + mutable'vertices + 18 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "language" + loop + (Lens.Family2.set + (Data.ProtoLens.Field.field @"language") + y + x) + mutable'edges + mutable'errors + mutable'vertices + 26 -> do !y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "vertices" + v <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.append + mutable'vertices + y) + loop x mutable'edges mutable'errors v + 34 -> do !y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "edges" + v <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.append + mutable'edges + y) + loop x v mutable'errors mutable'vertices + 42 -> do !y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "errors" + v <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.append + mutable'errors + y) + loop x mutable'edges v mutable'vertices + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + mutable'edges + mutable'errors + mutable'vertices + in + (do mutable'edges <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + Data.ProtoLens.Encoding.Growing.new + mutable'errors <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + Data.ProtoLens.Encoding.Growing.new + mutable'vertices <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + Data.ProtoLens.Encoding.Growing.new + loop Data.ProtoLens.defMessage mutable'edges mutable'errors + mutable'vertices) + Data.ProtoLens.Encoding.Bytes. "DiffTreeFileGraph" + buildMessage + = (\ _x -> + (let _v = Lens.Family2.view (Data.ProtoLens.Field.field @"path") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 10) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"language") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 18) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + (Data.ProtoLens.Encoding.Bytes.foldMapBuilder + (\ _v -> + (Data.ProtoLens.Encoding.Bytes.putVarInt 26) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + (Lens.Family2.view (Data.ProtoLens.Field.field @"vec'vertices") + _x)) + Data.Monoid.<> + (Data.ProtoLens.Encoding.Bytes.foldMapBuilder + (\ _v -> + (Data.ProtoLens.Encoding.Bytes.putVarInt 34) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + (Lens.Family2.view (Data.ProtoLens.Field.field @"vec'edges") _x)) + Data.Monoid.<> + (Data.ProtoLens.Encoding.Bytes.foldMapBuilder + (\ _v -> + (Data.ProtoLens.Encoding.Bytes.putVarInt 42) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + (Lens.Family2.view (Data.ProtoLens.Field.field @"vec'errors") _x)) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData DiffTreeFileGraph where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_DiffTreeFileGraph'_unknownFields x__) - (Control.DeepSeq.deepseq (_DiffTreeFileGraph'path x__) - (Control.DeepSeq.deepseq (_DiffTreeFileGraph'language x__) - (Control.DeepSeq.deepseq (_DiffTreeFileGraph'vertices x__) - (Control.DeepSeq.deepseq (_DiffTreeFileGraph'edges x__) - (Control.DeepSeq.deepseq (_DiffTreeFileGraph'errors x__) (())))))) + = (\ x__ -> + Control.DeepSeq.deepseq (_DiffTreeFileGraph'_unknownFields x__) + (Control.DeepSeq.deepseq (_DiffTreeFileGraph'path x__) + (Control.DeepSeq.deepseq (_DiffTreeFileGraph'language x__) + (Control.DeepSeq.deepseq (_DiffTreeFileGraph'vertices x__) + (Control.DeepSeq.deepseq (_DiffTreeFileGraph'edges x__) + (Control.DeepSeq.deepseq (_DiffTreeFileGraph'errors x__) (()))))))) {- | Fields : * 'Proto.Semantic_Fields.files' @:: Lens' DiffTreeGraphResponse [DiffTreeFileGraph]@ + * 'Proto.Semantic_Fields.vec'files' @:: Lens' DiffTreeGraphResponse (Data.Vector.Vector DiffTreeFileGraph)@ -} data DiffTreeGraphResponse = DiffTreeGraphResponse{_DiffTreeGraphResponse'files - :: ![DiffTreeFileGraph], + :: !(Data.Vector.Vector DiffTreeFileGraph), _DiffTreeGraphResponse'_unknownFields :: !Data.ProtoLens.FieldSet} deriving (Prelude.Eq, Prelude.Ord) @@ -562,14 +1113,24 @@ instance Prelude.Show DiffTreeGraphResponse where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' DiffTreeGraphResponse "files" +instance Data.ProtoLens.Field.HasField DiffTreeGraphResponse + "files" ([DiffTreeFileGraph]) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _DiffTreeGraphResponse'files - (\ x__ y__ -> x__{_DiffTreeGraphResponse'files = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeGraphResponse'files + (\ x__ y__ -> x__{_DiffTreeGraphResponse'files = y__})) + Prelude.. + Lens.Family2.Unchecked.lens Data.Vector.Generic.toList + (\ _ y__ -> Data.Vector.Generic.fromList y__) +instance Data.ProtoLens.Field.HasField DiffTreeGraphResponse + "vec'files" + (Data.Vector.Vector DiffTreeFileGraph) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeGraphResponse'files + (\ x__ y__ -> x__{_DiffTreeGraphResponse'files = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message DiffTreeGraphResponse where messageName _ = Data.Text.pack "github.semantic.DiffTreeGraphResponse" @@ -579,8 +1140,7 @@ instance Data.ProtoLens.Message DiffTreeGraphResponse where (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor DiffTreeFileGraph) (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "files"))) + (Data.ProtoLens.Field.field @"files")) :: Data.ProtoLens.FieldDescriptor DiffTreeGraphResponse in Data.Map.fromList [(Data.ProtoLens.Tag 1, files__field_descriptor)] @@ -588,19 +1148,85 @@ instance Data.ProtoLens.Message DiffTreeGraphResponse where = Lens.Family2.Unchecked.lens _DiffTreeGraphResponse'_unknownFields (\ x__ y__ -> x__{_DiffTreeGraphResponse'_unknownFields = y__}) defMessage - = DiffTreeGraphResponse{_DiffTreeGraphResponse'files = [], + = DiffTreeGraphResponse{_DiffTreeGraphResponse'files = + Data.Vector.Generic.empty, _DiffTreeGraphResponse'_unknownFields = ([])} + parseMessage + = let loop :: + DiffTreeGraphResponse -> + Data.ProtoLens.Encoding.Growing.Growing Data.Vector.Vector + Data.ProtoLens.Encoding.Growing.RealWorld + DiffTreeFileGraph + -> Data.ProtoLens.Encoding.Bytes.Parser DiffTreeGraphResponse + loop x mutable'files + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do frozen'files <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.unsafeFreeze + mutable'files) + let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + (Lens.Family2.set (Data.ProtoLens.Field.field @"vec'files") + frozen'files + x)) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 10 -> do !y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "files" + v <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.append + mutable'files + y) + loop x v + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + mutable'files + in + (do mutable'files <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + Data.ProtoLens.Encoding.Growing.new + loop Data.ProtoLens.defMessage mutable'files) + Data.ProtoLens.Encoding.Bytes. "DiffTreeGraphResponse" + buildMessage + = (\ _x -> + (Data.ProtoLens.Encoding.Bytes.foldMapBuilder + (\ _v -> + (Data.ProtoLens.Encoding.Bytes.putVarInt 10) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + (Lens.Family2.view (Data.ProtoLens.Field.field @"vec'files") _x)) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData DiffTreeGraphResponse where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_DiffTreeGraphResponse'_unknownFields x__) - (Control.DeepSeq.deepseq (_DiffTreeGraphResponse'files x__) (())) + = (\ x__ -> + Control.DeepSeq.deepseq (_DiffTreeGraphResponse'_unknownFields x__) + (Control.DeepSeq.deepseq (_DiffTreeGraphResponse'files x__) (()))) {- | Fields : * 'Proto.Semantic_Fields.blobs' @:: Lens' DiffTreeRequest [BlobPair]@ + * 'Proto.Semantic_Fields.vec'blobs' @:: Lens' DiffTreeRequest (Data.Vector.Vector BlobPair)@ -} data DiffTreeRequest = DiffTreeRequest{_DiffTreeRequest'blobs :: - ![BlobPair], + !(Data.Vector.Vector BlobPair), _DiffTreeRequest'_unknownFields :: !Data.ProtoLens.FieldSet} deriving (Prelude.Eq, Prelude.Ord) instance Prelude.Show DiffTreeRequest where @@ -608,13 +1234,22 @@ instance Prelude.Show DiffTreeRequest where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' DiffTreeRequest "blobs" ([BlobPair]) +instance Data.ProtoLens.Field.HasField DiffTreeRequest "blobs" + ([BlobPair]) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _DiffTreeRequest'blobs - (\ x__ y__ -> x__{_DiffTreeRequest'blobs = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeRequest'blobs + (\ x__ y__ -> x__{_DiffTreeRequest'blobs = y__})) + Prelude.. + Lens.Family2.Unchecked.lens Data.Vector.Generic.toList + (\ _ y__ -> Data.Vector.Generic.fromList y__) +instance Data.ProtoLens.Field.HasField DiffTreeRequest "vec'blobs" + (Data.Vector.Vector BlobPair) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeRequest'blobs + (\ x__ y__ -> x__{_DiffTreeRequest'blobs = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message DiffTreeRequest where messageName _ = Data.Text.pack "github.semantic.DiffTreeRequest" fieldsByTag @@ -623,8 +1258,7 @@ instance Data.ProtoLens.Message DiffTreeRequest where (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor BlobPair) (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "blobs"))) + (Data.ProtoLens.Field.field @"blobs")) :: Data.ProtoLens.FieldDescriptor DiffTreeRequest in Data.Map.fromList [(Data.ProtoLens.Tag 1, blobs__field_descriptor)] @@ -632,19 +1266,85 @@ instance Data.ProtoLens.Message DiffTreeRequest where = Lens.Family2.Unchecked.lens _DiffTreeRequest'_unknownFields (\ x__ y__ -> x__{_DiffTreeRequest'_unknownFields = y__}) defMessage - = DiffTreeRequest{_DiffTreeRequest'blobs = [], + = DiffTreeRequest{_DiffTreeRequest'blobs = + Data.Vector.Generic.empty, _DiffTreeRequest'_unknownFields = ([])} + parseMessage + = let loop :: + DiffTreeRequest -> + Data.ProtoLens.Encoding.Growing.Growing Data.Vector.Vector + Data.ProtoLens.Encoding.Growing.RealWorld + BlobPair + -> Data.ProtoLens.Encoding.Bytes.Parser DiffTreeRequest + loop x mutable'blobs + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do frozen'blobs <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.unsafeFreeze + mutable'blobs) + let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + (Lens.Family2.set (Data.ProtoLens.Field.field @"vec'blobs") + frozen'blobs + x)) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 10 -> do !y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "blobs" + v <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.append + mutable'blobs + y) + loop x v + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + mutable'blobs + in + (do mutable'blobs <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + Data.ProtoLens.Encoding.Growing.new + loop Data.ProtoLens.defMessage mutable'blobs) + Data.ProtoLens.Encoding.Bytes. "DiffTreeRequest" + buildMessage + = (\ _x -> + (Data.ProtoLens.Encoding.Bytes.foldMapBuilder + (\ _v -> + (Data.ProtoLens.Encoding.Bytes.putVarInt 10) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + (Lens.Family2.view (Data.ProtoLens.Field.field @"vec'blobs") _x)) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData DiffTreeRequest where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_DiffTreeRequest'_unknownFields x__) - (Control.DeepSeq.deepseq (_DiffTreeRequest'blobs x__) (())) + = (\ x__ -> + Control.DeepSeq.deepseq (_DiffTreeRequest'_unknownFields x__) + (Control.DeepSeq.deepseq (_DiffTreeRequest'blobs x__) (()))) {- | Fields : * 'Proto.Semantic_Fields.files' @:: Lens' DiffTreeTOCResponse [TOCSummaryFile]@ + * 'Proto.Semantic_Fields.vec'files' @:: Lens' DiffTreeTOCResponse (Data.Vector.Vector TOCSummaryFile)@ -} data DiffTreeTOCResponse = DiffTreeTOCResponse{_DiffTreeTOCResponse'files - :: ![TOCSummaryFile], + :: !(Data.Vector.Vector TOCSummaryFile), _DiffTreeTOCResponse'_unknownFields :: !Data.ProtoLens.FieldSet} deriving (Prelude.Eq, Prelude.Ord) @@ -653,14 +1353,23 @@ instance Prelude.Show DiffTreeTOCResponse where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' DiffTreeTOCResponse "files" +instance Data.ProtoLens.Field.HasField DiffTreeTOCResponse "files" ([TOCSummaryFile]) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _DiffTreeTOCResponse'files - (\ x__ y__ -> x__{_DiffTreeTOCResponse'files = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeTOCResponse'files + (\ x__ y__ -> x__{_DiffTreeTOCResponse'files = y__})) + Prelude.. + Lens.Family2.Unchecked.lens Data.Vector.Generic.toList + (\ _ y__ -> Data.Vector.Generic.fromList y__) +instance Data.ProtoLens.Field.HasField DiffTreeTOCResponse + "vec'files" + (Data.Vector.Vector TOCSummaryFile) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeTOCResponse'files + (\ x__ y__ -> x__{_DiffTreeTOCResponse'files = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message DiffTreeTOCResponse where messageName _ = Data.Text.pack "github.semantic.DiffTreeTOCResponse" @@ -670,8 +1379,7 @@ instance Data.ProtoLens.Message DiffTreeTOCResponse where (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor TOCSummaryFile) (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "files"))) + (Data.ProtoLens.Field.field @"files")) :: Data.ProtoLens.FieldDescriptor DiffTreeTOCResponse in Data.Map.fromList [(Data.ProtoLens.Tag 1, files__field_descriptor)] @@ -679,13 +1387,78 @@ instance Data.ProtoLens.Message DiffTreeTOCResponse where = Lens.Family2.Unchecked.lens _DiffTreeTOCResponse'_unknownFields (\ x__ y__ -> x__{_DiffTreeTOCResponse'_unknownFields = y__}) defMessage - = DiffTreeTOCResponse{_DiffTreeTOCResponse'files = [], + = DiffTreeTOCResponse{_DiffTreeTOCResponse'files = + Data.Vector.Generic.empty, _DiffTreeTOCResponse'_unknownFields = ([])} + parseMessage + = let loop :: + DiffTreeTOCResponse -> + Data.ProtoLens.Encoding.Growing.Growing Data.Vector.Vector + Data.ProtoLens.Encoding.Growing.RealWorld + TOCSummaryFile + -> Data.ProtoLens.Encoding.Bytes.Parser DiffTreeTOCResponse + loop x mutable'files + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do frozen'files <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.unsafeFreeze + mutable'files) + let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + (Lens.Family2.set (Data.ProtoLens.Field.field @"vec'files") + frozen'files + x)) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 10 -> do !y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "files" + v <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.append + mutable'files + y) + loop x v + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + mutable'files + in + (do mutable'files <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + Data.ProtoLens.Encoding.Growing.new + loop Data.ProtoLens.defMessage mutable'files) + Data.ProtoLens.Encoding.Bytes. "DiffTreeTOCResponse" + buildMessage + = (\ _x -> + (Data.ProtoLens.Encoding.Bytes.foldMapBuilder + (\ _v -> + (Data.ProtoLens.Encoding.Bytes.putVarInt 10) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + (Lens.Family2.view (Data.ProtoLens.Field.field @"vec'files") _x)) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData DiffTreeTOCResponse where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_DiffTreeTOCResponse'_unknownFields x__) - (Control.DeepSeq.deepseq (_DiffTreeTOCResponse'files x__) (())) + = (\ x__ -> + Control.DeepSeq.deepseq (_DiffTreeTOCResponse'_unknownFields x__) + (Control.DeepSeq.deepseq (_DiffTreeTOCResponse'files x__) (()))) {- | Fields : * 'Proto.Semantic_Fields.diffVertexId' @:: Lens' DiffTreeVertex Data.Int.Int32@ @@ -715,57 +1488,72 @@ data DiffTreeVertex'DiffTerm = DiffTreeVertex'Deleted !DeletedTerm | DiffTreeVertex'Replaced !ReplacedTerm | DiffTreeVertex'Merged !MergedTerm deriving (Prelude.Show, Prelude.Eq, Prelude.Ord) -instance Lens.Labels.HasLens' DiffTreeVertex "diffVertexId" +instance Data.ProtoLens.Field.HasField DiffTreeVertex + "diffVertexId" (Data.Int.Int32) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffVertexId - (\ x__ y__ -> x__{_DiffTreeVertex'diffVertexId = y__})) - Prelude.id -instance Lens.Labels.HasLens' DiffTreeVertex "maybe'diffTerm" + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffVertexId + (\ x__ y__ -> x__{_DiffTreeVertex'diffVertexId = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField DiffTreeVertex + "maybe'diffTerm" (Prelude.Maybe DiffTreeVertex'DiffTerm) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm - (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) - Prelude.id -instance Lens.Labels.HasLens' DiffTreeVertex "maybe'deleted" + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm + (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField DiffTreeVertex + "maybe'deleted" (Prelude.Maybe DeletedTerm) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm - (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm + (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) + Prelude.. + Lens.Family2.Unchecked.lens + (\ x__ -> + case x__ of + Prelude.Just (DiffTreeVertex'Deleted x__val) -> Prelude.Just x__val + _otherwise -> Prelude.Nothing) + (\ _ y__ -> Prelude.fmap DiffTreeVertex'Deleted y__) +instance Data.ProtoLens.Field.HasField DiffTreeVertex "deleted" + (DeletedTerm) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm + (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) + Prelude.. (Lens.Family2.Unchecked.lens (\ x__ -> case x__ of Prelude.Just (DiffTreeVertex'Deleted x__val) -> Prelude.Just x__val _otherwise -> Prelude.Nothing) (\ _ y__ -> Prelude.fmap DiffTreeVertex'Deleted y__)) -instance Lens.Labels.HasLens' DiffTreeVertex "deleted" - (DeletedTerm) - where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm - (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) - ((Prelude..) - (Lens.Family2.Unchecked.lens - (\ x__ -> - case x__ of - Prelude.Just (DiffTreeVertex'Deleted x__val) -> Prelude.Just x__val - _otherwise -> Prelude.Nothing) - (\ _ y__ -> Prelude.fmap DiffTreeVertex'Deleted y__)) - (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage)) -instance Lens.Labels.HasLens' DiffTreeVertex "maybe'inserted" + Prelude.. Data.ProtoLens.maybeLens Data.ProtoLens.defMessage +instance Data.ProtoLens.Field.HasField DiffTreeVertex + "maybe'inserted" (Prelude.Maybe InsertedTerm) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm - (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm + (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) + Prelude.. + Lens.Family2.Unchecked.lens + (\ x__ -> + case x__ of + Prelude.Just (DiffTreeVertex'Inserted x__val) -> Prelude.Just + x__val + _otherwise -> Prelude.Nothing) + (\ _ y__ -> Prelude.fmap DiffTreeVertex'Inserted y__) +instance Data.ProtoLens.Field.HasField DiffTreeVertex "inserted" + (InsertedTerm) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm + (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) + Prelude.. (Lens.Family2.Unchecked.lens (\ x__ -> case x__ of @@ -773,29 +1561,29 @@ instance Lens.Labels.HasLens' DiffTreeVertex "maybe'inserted" x__val _otherwise -> Prelude.Nothing) (\ _ y__ -> Prelude.fmap DiffTreeVertex'Inserted y__)) -instance Lens.Labels.HasLens' DiffTreeVertex "inserted" - (InsertedTerm) - where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm - (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) - ((Prelude..) - (Lens.Family2.Unchecked.lens - (\ x__ -> - case x__ of - Prelude.Just (DiffTreeVertex'Inserted x__val) -> Prelude.Just - x__val - _otherwise -> Prelude.Nothing) - (\ _ y__ -> Prelude.fmap DiffTreeVertex'Inserted y__)) - (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage)) -instance Lens.Labels.HasLens' DiffTreeVertex "maybe'replaced" + Prelude.. Data.ProtoLens.maybeLens Data.ProtoLens.defMessage +instance Data.ProtoLens.Field.HasField DiffTreeVertex + "maybe'replaced" (Prelude.Maybe ReplacedTerm) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm - (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm + (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) + Prelude.. + Lens.Family2.Unchecked.lens + (\ x__ -> + case x__ of + Prelude.Just (DiffTreeVertex'Replaced x__val) -> Prelude.Just + x__val + _otherwise -> Prelude.Nothing) + (\ _ y__ -> Prelude.fmap DiffTreeVertex'Replaced y__) +instance Data.ProtoLens.Field.HasField DiffTreeVertex "replaced" + (ReplacedTerm) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm + (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) + Prelude.. (Lens.Family2.Unchecked.lens (\ x__ -> case x__ of @@ -803,49 +1591,35 @@ instance Lens.Labels.HasLens' DiffTreeVertex "maybe'replaced" x__val _otherwise -> Prelude.Nothing) (\ _ y__ -> Prelude.fmap DiffTreeVertex'Replaced y__)) -instance Lens.Labels.HasLens' DiffTreeVertex "replaced" - (ReplacedTerm) - where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm - (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) - ((Prelude..) - (Lens.Family2.Unchecked.lens - (\ x__ -> - case x__ of - Prelude.Just (DiffTreeVertex'Replaced x__val) -> Prelude.Just - x__val - _otherwise -> Prelude.Nothing) - (\ _ y__ -> Prelude.fmap DiffTreeVertex'Replaced y__)) - (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage)) -instance Lens.Labels.HasLens' DiffTreeVertex "maybe'merged" + Prelude.. Data.ProtoLens.maybeLens Data.ProtoLens.defMessage +instance Data.ProtoLens.Field.HasField DiffTreeVertex + "maybe'merged" (Prelude.Maybe MergedTerm) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm - (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm + (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) + Prelude.. + Lens.Family2.Unchecked.lens + (\ x__ -> + case x__ of + Prelude.Just (DiffTreeVertex'Merged x__val) -> Prelude.Just x__val + _otherwise -> Prelude.Nothing) + (\ _ y__ -> Prelude.fmap DiffTreeVertex'Merged y__) +instance Data.ProtoLens.Field.HasField DiffTreeVertex "merged" + (MergedTerm) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm + (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) + Prelude.. (Lens.Family2.Unchecked.lens (\ x__ -> case x__ of Prelude.Just (DiffTreeVertex'Merged x__val) -> Prelude.Just x__val _otherwise -> Prelude.Nothing) (\ _ y__ -> Prelude.fmap DiffTreeVertex'Merged y__)) -instance Lens.Labels.HasLens' DiffTreeVertex "merged" (MergedTerm) - where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _DiffTreeVertex'diffTerm - (\ x__ y__ -> x__{_DiffTreeVertex'diffTerm = y__})) - ((Prelude..) - (Lens.Family2.Unchecked.lens - (\ x__ -> - case x__ of - Prelude.Just (DiffTreeVertex'Merged x__val) -> Prelude.Just x__val - _otherwise -> Prelude.Nothing) - (\ _ y__ -> Prelude.fmap DiffTreeVertex'Merged y__)) - (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage)) + Prelude.. Data.ProtoLens.maybeLens Data.ProtoLens.defMessage instance Data.ProtoLens.Message DiffTreeVertex where messageName _ = Data.Text.pack "github.semantic.DiffTreeVertex" fieldsByTag @@ -854,40 +1628,35 @@ instance Data.ProtoLens.Message DiffTreeVertex where (Data.ProtoLens.ScalarField Data.ProtoLens.Int32Field :: Data.ProtoLens.FieldTypeDescriptor Data.Int.Int32) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "diffVertexId"))) + (Data.ProtoLens.Field.field @"diffVertexId")) :: Data.ProtoLens.FieldDescriptor DiffTreeVertex deleted__field_descriptor = Data.ProtoLens.FieldDescriptor "deleted" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor DeletedTerm) (Data.ProtoLens.OptionalField - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'deleted"))) + (Data.ProtoLens.Field.field @"maybe'deleted")) :: Data.ProtoLens.FieldDescriptor DiffTreeVertex inserted__field_descriptor = Data.ProtoLens.FieldDescriptor "inserted" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor InsertedTerm) (Data.ProtoLens.OptionalField - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'inserted"))) + (Data.ProtoLens.Field.field @"maybe'inserted")) :: Data.ProtoLens.FieldDescriptor DiffTreeVertex replaced__field_descriptor = Data.ProtoLens.FieldDescriptor "replaced" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor ReplacedTerm) (Data.ProtoLens.OptionalField - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'replaced"))) + (Data.ProtoLens.Field.field @"maybe'replaced")) :: Data.ProtoLens.FieldDescriptor DiffTreeVertex merged__field_descriptor = Data.ProtoLens.FieldDescriptor "merged" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor MergedTerm) (Data.ProtoLens.OptionalField - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'merged"))) + (Data.ProtoLens.Field.field @"maybe'merged")) :: Data.ProtoLens.FieldDescriptor DiffTreeVertex in Data.Map.fromList @@ -904,45 +1673,174 @@ instance Data.ProtoLens.Message DiffTreeVertex where Data.ProtoLens.fieldDefault, _DiffTreeVertex'diffTerm = Prelude.Nothing, _DiffTreeVertex'_unknownFields = ([])} + parseMessage + = let loop :: + DiffTreeVertex -> + Data.ProtoLens.Encoding.Bytes.Parser DiffTreeVertex + loop x + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + x) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 8 -> do y <- (Prelude.fmap Prelude.fromIntegral + Data.ProtoLens.Encoding.Bytes.getVarInt) + Data.ProtoLens.Encoding.Bytes. "diff_vertex_id" + loop + (Lens.Family2.set + (Data.ProtoLens.Field.field @"diffVertexId") + y + x) + 18 -> do y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "deleted" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"deleted") + y + x) + 26 -> do y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "inserted" + loop + (Lens.Family2.set + (Data.ProtoLens.Field.field @"inserted") + y + x) + 34 -> do y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "replaced" + loop + (Lens.Family2.set + (Data.ProtoLens.Field.field @"replaced") + y + x) + 42 -> do y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "merged" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"merged") + y + x) + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + in + (do loop Data.ProtoLens.defMessage) + Data.ProtoLens.Encoding.Bytes. "DiffTreeVertex" + buildMessage + = (\ _x -> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"diffVertexId") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 8) Data.Monoid.<> + ((Data.ProtoLens.Encoding.Bytes.putVarInt) Prelude.. + Prelude.fromIntegral) + _v) + Data.Monoid.<> + (case + Lens.Family2.view (Data.ProtoLens.Field.field @"maybe'diffTerm") _x + of + (Prelude.Nothing) -> Data.Monoid.mempty + Prelude.Just + (DiffTreeVertex'Deleted + v) -> (Data.ProtoLens.Encoding.Bytes.putVarInt 18) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + v + Prelude.Just + (DiffTreeVertex'Inserted + v) -> (Data.ProtoLens.Encoding.Bytes.putVarInt 26) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + v + Prelude.Just + (DiffTreeVertex'Replaced + v) -> (Data.ProtoLens.Encoding.Bytes.putVarInt 34) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + v + Prelude.Just + (DiffTreeVertex'Merged + v) -> (Data.ProtoLens.Encoding.Bytes.putVarInt 42) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + v) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData DiffTreeVertex where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_DiffTreeVertex'_unknownFields x__) - (Control.DeepSeq.deepseq (_DiffTreeVertex'diffVertexId x__) - (Control.DeepSeq.deepseq (_DiffTreeVertex'diffTerm x__) (()))) + = (\ x__ -> + Control.DeepSeq.deepseq (_DiffTreeVertex'_unknownFields x__) + (Control.DeepSeq.deepseq (_DiffTreeVertex'diffVertexId x__) + (Control.DeepSeq.deepseq (_DiffTreeVertex'diffTerm x__) (())))) instance Control.DeepSeq.NFData DiffTreeVertex'DiffTerm where rnf (DiffTreeVertex'Deleted x__) = Control.DeepSeq.rnf x__ rnf (DiffTreeVertex'Inserted x__) = Control.DeepSeq.rnf x__ rnf (DiffTreeVertex'Replaced x__) = Control.DeepSeq.rnf x__ rnf (DiffTreeVertex'Merged x__) = Control.DeepSeq.rnf x__ _DiffTreeVertex'Deleted :: - Lens.Labels.Prism.Prism' DiffTreeVertex'DiffTerm DeletedTerm + Data.ProtoLens.Prism.Prism' DiffTreeVertex'DiffTerm DeletedTerm _DiffTreeVertex'Deleted - = Lens.Labels.Prism.prism' DiffTreeVertex'Deleted + = Data.ProtoLens.Prism.prism' DiffTreeVertex'Deleted (\ p__ -> case p__ of DiffTreeVertex'Deleted p__val -> Prelude.Just p__val _otherwise -> Prelude.Nothing) _DiffTreeVertex'Inserted :: - Lens.Labels.Prism.Prism' DiffTreeVertex'DiffTerm InsertedTerm + Data.ProtoLens.Prism.Prism' DiffTreeVertex'DiffTerm InsertedTerm _DiffTreeVertex'Inserted - = Lens.Labels.Prism.prism' DiffTreeVertex'Inserted + = Data.ProtoLens.Prism.prism' DiffTreeVertex'Inserted (\ p__ -> case p__ of DiffTreeVertex'Inserted p__val -> Prelude.Just p__val _otherwise -> Prelude.Nothing) _DiffTreeVertex'Replaced :: - Lens.Labels.Prism.Prism' DiffTreeVertex'DiffTerm ReplacedTerm + Data.ProtoLens.Prism.Prism' DiffTreeVertex'DiffTerm ReplacedTerm _DiffTreeVertex'Replaced - = Lens.Labels.Prism.prism' DiffTreeVertex'Replaced + = Data.ProtoLens.Prism.prism' DiffTreeVertex'Replaced (\ p__ -> case p__ of DiffTreeVertex'Replaced p__val -> Prelude.Just p__val _otherwise -> Prelude.Nothing) _DiffTreeVertex'Merged :: - Lens.Labels.Prism.Prism' DiffTreeVertex'DiffTerm MergedTerm + Data.ProtoLens.Prism.Prism' DiffTreeVertex'DiffTerm MergedTerm _DiffTreeVertex'Merged - = Lens.Labels.Prism.prism' DiffTreeVertex'Merged + = Data.ProtoLens.Prism.prism' DiffTreeVertex'Merged (\ p__ -> case p__ of DiffTreeVertex'Merged p__val -> Prelude.Just p__val @@ -959,14 +1857,13 @@ instance Prelude.Show Docstring where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' Docstring "docstring" +instance Data.ProtoLens.Field.HasField Docstring "docstring" (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _Docstring'docstring - (\ x__ y__ -> x__{_Docstring'docstring = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _Docstring'docstring + (\ x__ y__ -> x__{_Docstring'docstring = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message Docstring where messageName _ = Data.Text.pack "github.semantic.Docstring" fieldsByTag @@ -975,8 +1872,7 @@ instance Data.ProtoLens.Message Docstring where (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "docstring"))) + (Data.ProtoLens.Field.field @"docstring")) :: Data.ProtoLens.FieldDescriptor Docstring in Data.Map.fromList @@ -987,22 +1883,84 @@ instance Data.ProtoLens.Message Docstring where defMessage = Docstring{_Docstring'docstring = Data.ProtoLens.fieldDefault, _Docstring'_unknownFields = ([])} + parseMessage + = let loop :: + Docstring -> Data.ProtoLens.Encoding.Bytes.Parser Docstring + loop x + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + x) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 10 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "docstring" + loop + (Lens.Family2.set + (Data.ProtoLens.Field.field @"docstring") + y + x) + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + in + (do loop Data.ProtoLens.defMessage) + Data.ProtoLens.Encoding.Bytes. "Docstring" + buildMessage + = (\ _x -> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"docstring") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 10) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData Docstring where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_Docstring'_unknownFields x__) - (Control.DeepSeq.deepseq (_Docstring'docstring x__) (())) + = (\ x__ -> + Control.DeepSeq.deepseq (_Docstring'_unknownFields x__) + (Control.DeepSeq.deepseq (_Docstring'docstring x__) (()))) {- | Fields : * 'Proto.Semantic_Fields.path' @:: Lens' File Data.Text.Text@ * 'Proto.Semantic_Fields.language' @:: Lens' File Data.Text.Text@ * 'Proto.Semantic_Fields.symbols' @:: Lens' File [Symbol]@ + * 'Proto.Semantic_Fields.vec'symbols' @:: Lens' File (Data.Vector.Vector Symbol)@ * 'Proto.Semantic_Fields.errors' @:: Lens' File [ParseError]@ + * 'Proto.Semantic_Fields.vec'errors' @:: Lens' File (Data.Vector.Vector ParseError)@ * 'Proto.Semantic_Fields.blobOid' @:: Lens' File Data.Text.Text@ -} data File = File{_File'path :: !Data.Text.Text, - _File'language :: !Data.Text.Text, _File'symbols :: ![Symbol], - _File'errors :: ![ParseError], _File'blobOid :: !Data.Text.Text, + _File'language :: !Data.Text.Text, + _File'symbols :: !(Data.Vector.Vector Symbol), + _File'errors :: !(Data.Vector.Vector ParseError), + _File'blobOid :: !Data.Text.Text, _File'_unknownFields :: !Data.ProtoLens.FieldSet} deriving (Prelude.Eq, Prelude.Ord) instance Prelude.Show File where @@ -1010,37 +1968,56 @@ instance Prelude.Show File where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' File "path" (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _File'path - (\ x__ y__ -> x__{_File'path = y__})) - Prelude.id -instance Lens.Labels.HasLens' File "language" (Data.Text.Text) +instance Data.ProtoLens.Field.HasField File "path" (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _File'language - (\ x__ y__ -> x__{_File'language = y__})) - Prelude.id -instance Lens.Labels.HasLens' File "symbols" ([Symbol]) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _File'symbols - (\ x__ y__ -> x__{_File'symbols = y__})) - Prelude.id -instance Lens.Labels.HasLens' File "errors" ([ParseError]) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _File'errors - (\ x__ y__ -> x__{_File'errors = y__})) - Prelude.id -instance Lens.Labels.HasLens' File "blobOid" (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _File'blobOid - (\ x__ y__ -> x__{_File'blobOid = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _File'path + (\ x__ y__ -> x__{_File'path = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField File "language" + (Data.Text.Text) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _File'language + (\ x__ y__ -> x__{_File'language = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField File "symbols" ([Symbol]) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _File'symbols + (\ x__ y__ -> x__{_File'symbols = y__})) + Prelude.. + Lens.Family2.Unchecked.lens Data.Vector.Generic.toList + (\ _ y__ -> Data.Vector.Generic.fromList y__) +instance Data.ProtoLens.Field.HasField File "vec'symbols" + (Data.Vector.Vector Symbol) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _File'symbols + (\ x__ y__ -> x__{_File'symbols = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField File "errors" ([ParseError]) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _File'errors + (\ x__ y__ -> x__{_File'errors = y__})) + Prelude.. + Lens.Family2.Unchecked.lens Data.Vector.Generic.toList + (\ _ y__ -> Data.Vector.Generic.fromList y__) +instance Data.ProtoLens.Field.HasField File "vec'errors" + (Data.Vector.Vector ParseError) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _File'errors + (\ x__ y__ -> x__{_File'errors = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField File "blobOid" + (Data.Text.Text) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _File'blobOid + (\ x__ y__ -> x__{_File'blobOid = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message File where messageName _ = Data.Text.pack "github.semantic.File" fieldsByTag @@ -1049,40 +2026,35 @@ instance Data.ProtoLens.Message File where (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "path"))) + (Data.ProtoLens.Field.field @"path")) :: Data.ProtoLens.FieldDescriptor File language__field_descriptor = Data.ProtoLens.FieldDescriptor "language" (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "language"))) + (Data.ProtoLens.Field.field @"language")) :: Data.ProtoLens.FieldDescriptor File symbols__field_descriptor = Data.ProtoLens.FieldDescriptor "symbols" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor Symbol) (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "symbols"))) + (Data.ProtoLens.Field.field @"symbols")) :: Data.ProtoLens.FieldDescriptor File errors__field_descriptor = Data.ProtoLens.FieldDescriptor "errors" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor ParseError) (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "errors"))) + (Data.ProtoLens.Field.field @"errors")) :: Data.ProtoLens.FieldDescriptor File blobOid__field_descriptor = Data.ProtoLens.FieldDescriptor "blob_oid" (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "blobOid"))) + (Data.ProtoLens.Field.field @"blobOid")) :: Data.ProtoLens.FieldDescriptor File in Data.Map.fromList @@ -1096,18 +2068,200 @@ instance Data.ProtoLens.Message File where (\ x__ y__ -> x__{_File'_unknownFields = y__}) defMessage = File{_File'path = Data.ProtoLens.fieldDefault, - _File'language = Data.ProtoLens.fieldDefault, _File'symbols = [], - _File'errors = [], _File'blobOid = Data.ProtoLens.fieldDefault, + _File'language = Data.ProtoLens.fieldDefault, + _File'symbols = Data.Vector.Generic.empty, + _File'errors = Data.Vector.Generic.empty, + _File'blobOid = Data.ProtoLens.fieldDefault, _File'_unknownFields = ([])} + parseMessage + = let loop :: + File -> + Data.ProtoLens.Encoding.Growing.Growing Data.Vector.Vector + Data.ProtoLens.Encoding.Growing.RealWorld + ParseError + -> + Data.ProtoLens.Encoding.Growing.Growing Data.Vector.Vector + Data.ProtoLens.Encoding.Growing.RealWorld + Symbol + -> Data.ProtoLens.Encoding.Bytes.Parser File + loop x mutable'errors mutable'symbols + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do frozen'errors <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.unsafeFreeze + mutable'errors) + frozen'symbols <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.unsafeFreeze + mutable'symbols) + let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + (Lens.Family2.set (Data.ProtoLens.Field.field @"vec'errors") + frozen'errors + (Lens.Family2.set (Data.ProtoLens.Field.field @"vec'symbols") + frozen'symbols + x))) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 10 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "path" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"path") y + x) + mutable'errors + mutable'symbols + 18 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "language" + loop + (Lens.Family2.set + (Data.ProtoLens.Field.field @"language") + y + x) + mutable'errors + mutable'symbols + 26 -> do !y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "symbols" + v <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.append + mutable'symbols + y) + loop x mutable'errors v + 34 -> do !y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "errors" + v <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.append + mutable'errors + y) + loop x v mutable'symbols + 42 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "blob_oid" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"blobOid") + y + x) + mutable'errors + mutable'symbols + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + mutable'errors + mutable'symbols + in + (do mutable'errors <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + Data.ProtoLens.Encoding.Growing.new + mutable'symbols <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + Data.ProtoLens.Encoding.Growing.new + loop Data.ProtoLens.defMessage mutable'errors mutable'symbols) + Data.ProtoLens.Encoding.Bytes. "File" + buildMessage + = (\ _x -> + (let _v = Lens.Family2.view (Data.ProtoLens.Field.field @"path") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 10) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"language") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 18) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + (Data.ProtoLens.Encoding.Bytes.foldMapBuilder + (\ _v -> + (Data.ProtoLens.Encoding.Bytes.putVarInt 26) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + (Lens.Family2.view (Data.ProtoLens.Field.field @"vec'symbols") _x)) + Data.Monoid.<> + (Data.ProtoLens.Encoding.Bytes.foldMapBuilder + (\ _v -> + (Data.ProtoLens.Encoding.Bytes.putVarInt 34) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + (Lens.Family2.view (Data.ProtoLens.Field.field @"vec'errors") _x)) + Data.Monoid.<> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"blobOid") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 42) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData File where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_File'_unknownFields x__) - (Control.DeepSeq.deepseq (_File'path x__) - (Control.DeepSeq.deepseq (_File'language x__) - (Control.DeepSeq.deepseq (_File'symbols x__) - (Control.DeepSeq.deepseq (_File'errors x__) - (Control.DeepSeq.deepseq (_File'blobOid x__) (())))))) + = (\ x__ -> + Control.DeepSeq.deepseq (_File'_unknownFields x__) + (Control.DeepSeq.deepseq (_File'path x__) + (Control.DeepSeq.deepseq (_File'language x__) + (Control.DeepSeq.deepseq (_File'symbols x__) + (Control.DeepSeq.deepseq (_File'errors x__) + (Control.DeepSeq.deepseq (_File'blobOid x__) (()))))))) {- | Fields : * 'Proto.Semantic_Fields.term' @:: Lens' InsertedTerm Data.Text.Text@ @@ -1124,27 +2278,26 @@ instance Prelude.Show InsertedTerm where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' InsertedTerm "term" (Data.Text.Text) +instance Data.ProtoLens.Field.HasField InsertedTerm "term" + (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _InsertedTerm'term - (\ x__ y__ -> x__{_InsertedTerm'term = y__})) - Prelude.id -instance Lens.Labels.HasLens' InsertedTerm "span" (Span) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _InsertedTerm'span - (\ x__ y__ -> x__{_InsertedTerm'span = y__})) - (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) -instance Lens.Labels.HasLens' InsertedTerm "maybe'span" + fieldOf _ + = (Lens.Family2.Unchecked.lens _InsertedTerm'term + (\ x__ y__ -> x__{_InsertedTerm'term = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField InsertedTerm "span" (Span) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _InsertedTerm'span + (\ x__ y__ -> x__{_InsertedTerm'span = y__})) + Prelude.. Data.ProtoLens.maybeLens Data.ProtoLens.defMessage +instance Data.ProtoLens.Field.HasField InsertedTerm "maybe'span" (Prelude.Maybe Span) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _InsertedTerm'span - (\ x__ y__ -> x__{_InsertedTerm'span = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _InsertedTerm'span + (\ x__ y__ -> x__{_InsertedTerm'span = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message InsertedTerm where messageName _ = Data.Text.pack "github.semantic.InsertedTerm" fieldsByTag @@ -1153,16 +2306,14 @@ instance Data.ProtoLens.Message InsertedTerm where (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "term"))) + (Data.ProtoLens.Field.field @"term")) :: Data.ProtoLens.FieldDescriptor InsertedTerm span__field_descriptor = Data.ProtoLens.FieldDescriptor "span" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor Span) (Data.ProtoLens.OptionalField - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'span"))) + (Data.ProtoLens.Field.field @"maybe'span")) :: Data.ProtoLens.FieldDescriptor InsertedTerm in Data.Map.fromList @@ -1175,12 +2326,89 @@ instance Data.ProtoLens.Message InsertedTerm where = InsertedTerm{_InsertedTerm'term = Data.ProtoLens.fieldDefault, _InsertedTerm'span = Prelude.Nothing, _InsertedTerm'_unknownFields = ([])} + parseMessage + = let loop :: + InsertedTerm -> Data.ProtoLens.Encoding.Bytes.Parser InsertedTerm + loop x + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + x) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 10 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "term" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"term") y + x) + 18 -> do y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "span" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"span") y + x) + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + in + (do loop Data.ProtoLens.defMessage) + Data.ProtoLens.Encoding.Bytes. "InsertedTerm" + buildMessage + = (\ _x -> + (let _v = Lens.Family2.view (Data.ProtoLens.Field.field @"term") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 10) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + (case + Lens.Family2.view (Data.ProtoLens.Field.field @"maybe'span") _x of + (Prelude.Nothing) -> Data.Monoid.mempty + Prelude.Just _v -> (Data.ProtoLens.Encoding.Bytes.putVarInt 18) + Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral + (Data.ByteString.length bs))) + Data.Monoid.<> + Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData InsertedTerm where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_InsertedTerm'_unknownFields x__) - (Control.DeepSeq.deepseq (_InsertedTerm'term x__) - (Control.DeepSeq.deepseq (_InsertedTerm'span x__) (()))) + = (\ x__ -> + Control.DeepSeq.deepseq (_InsertedTerm'_unknownFields x__) + (Control.DeepSeq.deepseq (_InsertedTerm'term x__) + (Control.DeepSeq.deepseq (_InsertedTerm'span x__) (())))) {- | Fields : * 'Proto.Semantic_Fields.term' @:: Lens' MergedTerm Data.Text.Text@ @@ -1199,41 +2427,42 @@ instance Prelude.Show MergedTerm where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' MergedTerm "term" (Data.Text.Text) +instance Data.ProtoLens.Field.HasField MergedTerm "term" + (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _MergedTerm'term - (\ x__ y__ -> x__{_MergedTerm'term = y__})) - Prelude.id -instance Lens.Labels.HasLens' MergedTerm "beforeSpan" (Span) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _MergedTerm'beforeSpan - (\ x__ y__ -> x__{_MergedTerm'beforeSpan = y__})) - (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) -instance Lens.Labels.HasLens' MergedTerm "maybe'beforeSpan" + fieldOf _ + = (Lens.Family2.Unchecked.lens _MergedTerm'term + (\ x__ y__ -> x__{_MergedTerm'term = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField MergedTerm "beforeSpan" + (Span) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _MergedTerm'beforeSpan + (\ x__ y__ -> x__{_MergedTerm'beforeSpan = y__})) + Prelude.. Data.ProtoLens.maybeLens Data.ProtoLens.defMessage +instance Data.ProtoLens.Field.HasField MergedTerm + "maybe'beforeSpan" (Prelude.Maybe Span) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _MergedTerm'beforeSpan - (\ x__ y__ -> x__{_MergedTerm'beforeSpan = y__})) - Prelude.id -instance Lens.Labels.HasLens' MergedTerm "afterSpan" (Span) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _MergedTerm'afterSpan - (\ x__ y__ -> x__{_MergedTerm'afterSpan = y__})) - (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) -instance Lens.Labels.HasLens' MergedTerm "maybe'afterSpan" + fieldOf _ + = (Lens.Family2.Unchecked.lens _MergedTerm'beforeSpan + (\ x__ y__ -> x__{_MergedTerm'beforeSpan = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField MergedTerm "afterSpan" + (Span) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _MergedTerm'afterSpan + (\ x__ y__ -> x__{_MergedTerm'afterSpan = y__})) + Prelude.. Data.ProtoLens.maybeLens Data.ProtoLens.defMessage +instance Data.ProtoLens.Field.HasField MergedTerm "maybe'afterSpan" (Prelude.Maybe Span) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _MergedTerm'afterSpan - (\ x__ y__ -> x__{_MergedTerm'afterSpan = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _MergedTerm'afterSpan + (\ x__ y__ -> x__{_MergedTerm'afterSpan = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message MergedTerm where messageName _ = Data.Text.pack "github.semantic.MergedTerm" fieldsByTag @@ -1242,24 +2471,21 @@ instance Data.ProtoLens.Message MergedTerm where (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "term"))) + (Data.ProtoLens.Field.field @"term")) :: Data.ProtoLens.FieldDescriptor MergedTerm beforeSpan__field_descriptor = Data.ProtoLens.FieldDescriptor "before_span" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor Span) (Data.ProtoLens.OptionalField - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'beforeSpan"))) + (Data.ProtoLens.Field.field @"maybe'beforeSpan")) :: Data.ProtoLens.FieldDescriptor MergedTerm afterSpan__field_descriptor = Data.ProtoLens.FieldDescriptor "after_span" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor Span) (Data.ProtoLens.OptionalField - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'afterSpan"))) + (Data.ProtoLens.Field.field @"maybe'afterSpan")) :: Data.ProtoLens.FieldDescriptor MergedTerm in Data.Map.fromList @@ -1274,13 +2500,120 @@ instance Data.ProtoLens.Message MergedTerm where _MergedTerm'beforeSpan = Prelude.Nothing, _MergedTerm'afterSpan = Prelude.Nothing, _MergedTerm'_unknownFields = ([])} + parseMessage + = let loop :: + MergedTerm -> Data.ProtoLens.Encoding.Bytes.Parser MergedTerm + loop x + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + x) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 10 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "term" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"term") y + x) + 18 -> do y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "before_span" + loop + (Lens.Family2.set + (Data.ProtoLens.Field.field @"beforeSpan") + y + x) + 26 -> do y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "after_span" + loop + (Lens.Family2.set + (Data.ProtoLens.Field.field @"afterSpan") + y + x) + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + in + (do loop Data.ProtoLens.defMessage) + Data.ProtoLens.Encoding.Bytes. "MergedTerm" + buildMessage + = (\ _x -> + (let _v = Lens.Family2.view (Data.ProtoLens.Field.field @"term") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 10) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + (case + Lens.Family2.view (Data.ProtoLens.Field.field @"maybe'beforeSpan") + _x + of + (Prelude.Nothing) -> Data.Monoid.mempty + Prelude.Just _v -> (Data.ProtoLens.Encoding.Bytes.putVarInt 18) + Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral + (Data.ByteString.length bs))) + Data.Monoid.<> + Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + Data.Monoid.<> + (case + Lens.Family2.view (Data.ProtoLens.Field.field @"maybe'afterSpan") + _x + of + (Prelude.Nothing) -> Data.Monoid.mempty + Prelude.Just _v -> (Data.ProtoLens.Encoding.Bytes.putVarInt 26) + Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral + (Data.ByteString.length bs))) + Data.Monoid.<> + Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData MergedTerm where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_MergedTerm'_unknownFields x__) - (Control.DeepSeq.deepseq (_MergedTerm'term x__) - (Control.DeepSeq.deepseq (_MergedTerm'beforeSpan x__) - (Control.DeepSeq.deepseq (_MergedTerm'afterSpan x__) (())))) + = (\ x__ -> + Control.DeepSeq.deepseq (_MergedTerm'_unknownFields x__) + (Control.DeepSeq.deepseq (_MergedTerm'term x__) + (Control.DeepSeq.deepseq (_MergedTerm'beforeSpan x__) + (Control.DeepSeq.deepseq (_MergedTerm'afterSpan x__) (()))))) {- | Fields : * 'Proto.Semantic_Fields.error' @:: Lens' ParseError Data.Text.Text@ @@ -1293,13 +2626,13 @@ instance Prelude.Show ParseError where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' ParseError "error" (Data.Text.Text) +instance Data.ProtoLens.Field.HasField ParseError "error" + (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _ParseError'error - (\ x__ y__ -> x__{_ParseError'error = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _ParseError'error + (\ x__ y__ -> x__{_ParseError'error = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message ParseError where messageName _ = Data.Text.pack "github.semantic.ParseError" fieldsByTag @@ -1308,8 +2641,7 @@ instance Data.ProtoLens.Message ParseError where (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "error"))) + (Data.ProtoLens.Field.field @"error")) :: Data.ProtoLens.FieldDescriptor ParseError in Data.Map.fromList [(Data.ProtoLens.Tag 1, error__field_descriptor)] @@ -1319,25 +2651,87 @@ instance Data.ProtoLens.Message ParseError where defMessage = ParseError{_ParseError'error = Data.ProtoLens.fieldDefault, _ParseError'_unknownFields = ([])} + parseMessage + = let loop :: + ParseError -> Data.ProtoLens.Encoding.Bytes.Parser ParseError + loop x + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + x) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 10 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "error" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"error") y + x) + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + in + (do loop Data.ProtoLens.defMessage) + Data.ProtoLens.Encoding.Bytes. "ParseError" + buildMessage + = (\ _x -> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"error") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 10) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData ParseError where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_ParseError'_unknownFields x__) - (Control.DeepSeq.deepseq (_ParseError'error x__) (())) + = (\ x__ -> + Control.DeepSeq.deepseq (_ParseError'_unknownFields x__) + (Control.DeepSeq.deepseq (_ParseError'error x__) (()))) {- | Fields : * 'Proto.Semantic_Fields.path' @:: Lens' ParseTreeFileGraph Data.Text.Text@ * 'Proto.Semantic_Fields.language' @:: Lens' ParseTreeFileGraph Data.Text.Text@ * 'Proto.Semantic_Fields.vertices' @:: Lens' ParseTreeFileGraph [TermVertex]@ + * 'Proto.Semantic_Fields.vec'vertices' @:: Lens' ParseTreeFileGraph (Data.Vector.Vector TermVertex)@ * 'Proto.Semantic_Fields.edges' @:: Lens' ParseTreeFileGraph [TermEdge]@ + * 'Proto.Semantic_Fields.vec'edges' @:: Lens' ParseTreeFileGraph (Data.Vector.Vector TermEdge)@ * 'Proto.Semantic_Fields.errors' @:: Lens' ParseTreeFileGraph [ParseError]@ + * 'Proto.Semantic_Fields.vec'errors' @:: Lens' ParseTreeFileGraph (Data.Vector.Vector ParseError)@ -} data ParseTreeFileGraph = ParseTreeFileGraph{_ParseTreeFileGraph'path :: !Data.Text.Text, _ParseTreeFileGraph'language :: !Data.Text.Text, - _ParseTreeFileGraph'vertices :: ![TermVertex], - _ParseTreeFileGraph'edges :: ![TermEdge], - _ParseTreeFileGraph'errors :: ![ParseError], + _ParseTreeFileGraph'vertices :: + !(Data.Vector.Vector TermVertex), + _ParseTreeFileGraph'edges :: + !(Data.Vector.Vector TermEdge), + _ParseTreeFileGraph'errors :: + !(Data.Vector.Vector ParseError), _ParseTreeFileGraph'_unknownFields :: !Data.ProtoLens.FieldSet} deriving (Prelude.Eq, Prelude.Ord) @@ -1346,46 +2740,73 @@ instance Prelude.Show ParseTreeFileGraph where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' ParseTreeFileGraph "path" +instance Data.ProtoLens.Field.HasField ParseTreeFileGraph "path" (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _ParseTreeFileGraph'path - (\ x__ y__ -> x__{_ParseTreeFileGraph'path = y__})) - Prelude.id -instance Lens.Labels.HasLens' ParseTreeFileGraph "language" + fieldOf _ + = (Lens.Family2.Unchecked.lens _ParseTreeFileGraph'path + (\ x__ y__ -> x__{_ParseTreeFileGraph'path = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField ParseTreeFileGraph + "language" (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _ParseTreeFileGraph'language - (\ x__ y__ -> x__{_ParseTreeFileGraph'language = y__})) - Prelude.id -instance Lens.Labels.HasLens' ParseTreeFileGraph "vertices" + fieldOf _ + = (Lens.Family2.Unchecked.lens _ParseTreeFileGraph'language + (\ x__ y__ -> x__{_ParseTreeFileGraph'language = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField ParseTreeFileGraph + "vertices" ([TermVertex]) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _ParseTreeFileGraph'vertices - (\ x__ y__ -> x__{_ParseTreeFileGraph'vertices = y__})) - Prelude.id -instance Lens.Labels.HasLens' ParseTreeFileGraph "edges" + fieldOf _ + = (Lens.Family2.Unchecked.lens _ParseTreeFileGraph'vertices + (\ x__ y__ -> x__{_ParseTreeFileGraph'vertices = y__})) + Prelude.. + Lens.Family2.Unchecked.lens Data.Vector.Generic.toList + (\ _ y__ -> Data.Vector.Generic.fromList y__) +instance Data.ProtoLens.Field.HasField ParseTreeFileGraph + "vec'vertices" + (Data.Vector.Vector TermVertex) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _ParseTreeFileGraph'vertices + (\ x__ y__ -> x__{_ParseTreeFileGraph'vertices = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField ParseTreeFileGraph "edges" ([TermEdge]) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _ParseTreeFileGraph'edges - (\ x__ y__ -> x__{_ParseTreeFileGraph'edges = y__})) - Prelude.id -instance Lens.Labels.HasLens' ParseTreeFileGraph "errors" + fieldOf _ + = (Lens.Family2.Unchecked.lens _ParseTreeFileGraph'edges + (\ x__ y__ -> x__{_ParseTreeFileGraph'edges = y__})) + Prelude.. + Lens.Family2.Unchecked.lens Data.Vector.Generic.toList + (\ _ y__ -> Data.Vector.Generic.fromList y__) +instance Data.ProtoLens.Field.HasField ParseTreeFileGraph + "vec'edges" + (Data.Vector.Vector TermEdge) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _ParseTreeFileGraph'edges + (\ x__ y__ -> x__{_ParseTreeFileGraph'edges = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField ParseTreeFileGraph "errors" ([ParseError]) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _ParseTreeFileGraph'errors - (\ x__ y__ -> x__{_ParseTreeFileGraph'errors = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _ParseTreeFileGraph'errors + (\ x__ y__ -> x__{_ParseTreeFileGraph'errors = y__})) + Prelude.. + Lens.Family2.Unchecked.lens Data.Vector.Generic.toList + (\ _ y__ -> Data.Vector.Generic.fromList y__) +instance Data.ProtoLens.Field.HasField ParseTreeFileGraph + "vec'errors" + (Data.Vector.Vector ParseError) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _ParseTreeFileGraph'errors + (\ x__ y__ -> x__{_ParseTreeFileGraph'errors = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message ParseTreeFileGraph where messageName _ = Data.Text.pack "github.semantic.ParseTreeFileGraph" fieldsByTag @@ -1394,40 +2815,35 @@ instance Data.ProtoLens.Message ParseTreeFileGraph where (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "path"))) + (Data.ProtoLens.Field.field @"path")) :: Data.ProtoLens.FieldDescriptor ParseTreeFileGraph language__field_descriptor = Data.ProtoLens.FieldDescriptor "language" (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "language"))) + (Data.ProtoLens.Field.field @"language")) :: Data.ProtoLens.FieldDescriptor ParseTreeFileGraph vertices__field_descriptor = Data.ProtoLens.FieldDescriptor "vertices" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor TermVertex) (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "vertices"))) + (Data.ProtoLens.Field.field @"vertices")) :: Data.ProtoLens.FieldDescriptor ParseTreeFileGraph edges__field_descriptor = Data.ProtoLens.FieldDescriptor "edges" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor TermEdge) (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "edges"))) + (Data.ProtoLens.Field.field @"edges")) :: Data.ProtoLens.FieldDescriptor ParseTreeFileGraph errors__field_descriptor = Data.ProtoLens.FieldDescriptor "errors" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor ParseError) (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "errors"))) + (Data.ProtoLens.Field.field @"errors")) :: Data.ProtoLens.FieldDescriptor ParseTreeFileGraph in Data.Map.fromList @@ -1443,24 +2859,218 @@ instance Data.ProtoLens.Message ParseTreeFileGraph where = ParseTreeFileGraph{_ParseTreeFileGraph'path = Data.ProtoLens.fieldDefault, _ParseTreeFileGraph'language = Data.ProtoLens.fieldDefault, - _ParseTreeFileGraph'vertices = [], _ParseTreeFileGraph'edges = [], - _ParseTreeFileGraph'errors = [], + _ParseTreeFileGraph'vertices = Data.Vector.Generic.empty, + _ParseTreeFileGraph'edges = Data.Vector.Generic.empty, + _ParseTreeFileGraph'errors = Data.Vector.Generic.empty, _ParseTreeFileGraph'_unknownFields = ([])} + parseMessage + = let loop :: + ParseTreeFileGraph -> + Data.ProtoLens.Encoding.Growing.Growing Data.Vector.Vector + Data.ProtoLens.Encoding.Growing.RealWorld + TermEdge + -> + Data.ProtoLens.Encoding.Growing.Growing Data.Vector.Vector + Data.ProtoLens.Encoding.Growing.RealWorld + ParseError + -> + Data.ProtoLens.Encoding.Growing.Growing Data.Vector.Vector + Data.ProtoLens.Encoding.Growing.RealWorld + TermVertex + -> Data.ProtoLens.Encoding.Bytes.Parser ParseTreeFileGraph + loop x mutable'edges mutable'errors mutable'vertices + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do frozen'edges <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.unsafeFreeze + mutable'edges) + frozen'errors <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.unsafeFreeze + mutable'errors) + frozen'vertices <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.unsafeFreeze + mutable'vertices) + let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + (Lens.Family2.set (Data.ProtoLens.Field.field @"vec'edges") + frozen'edges + (Lens.Family2.set (Data.ProtoLens.Field.field @"vec'errors") + frozen'errors + (Lens.Family2.set + (Data.ProtoLens.Field.field @"vec'vertices") + frozen'vertices + x)))) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 10 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "path" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"path") y + x) + mutable'edges + mutable'errors + mutable'vertices + 18 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "language" + loop + (Lens.Family2.set + (Data.ProtoLens.Field.field @"language") + y + x) + mutable'edges + mutable'errors + mutable'vertices + 26 -> do !y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "vertices" + v <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.append + mutable'vertices + y) + loop x mutable'edges mutable'errors v + 34 -> do !y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "edges" + v <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.append + mutable'edges + y) + loop x v mutable'errors mutable'vertices + 42 -> do !y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "errors" + v <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.append + mutable'errors + y) + loop x mutable'edges v mutable'vertices + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + mutable'edges + mutable'errors + mutable'vertices + in + (do mutable'edges <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + Data.ProtoLens.Encoding.Growing.new + mutable'errors <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + Data.ProtoLens.Encoding.Growing.new + mutable'vertices <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + Data.ProtoLens.Encoding.Growing.new + loop Data.ProtoLens.defMessage mutable'edges mutable'errors + mutable'vertices) + Data.ProtoLens.Encoding.Bytes. "ParseTreeFileGraph" + buildMessage + = (\ _x -> + (let _v = Lens.Family2.view (Data.ProtoLens.Field.field @"path") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 10) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"language") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 18) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + (Data.ProtoLens.Encoding.Bytes.foldMapBuilder + (\ _v -> + (Data.ProtoLens.Encoding.Bytes.putVarInt 26) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + (Lens.Family2.view (Data.ProtoLens.Field.field @"vec'vertices") + _x)) + Data.Monoid.<> + (Data.ProtoLens.Encoding.Bytes.foldMapBuilder + (\ _v -> + (Data.ProtoLens.Encoding.Bytes.putVarInt 34) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + (Lens.Family2.view (Data.ProtoLens.Field.field @"vec'edges") _x)) + Data.Monoid.<> + (Data.ProtoLens.Encoding.Bytes.foldMapBuilder + (\ _v -> + (Data.ProtoLens.Encoding.Bytes.putVarInt 42) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + (Lens.Family2.view (Data.ProtoLens.Field.field @"vec'errors") _x)) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData ParseTreeFileGraph where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_ParseTreeFileGraph'_unknownFields x__) - (Control.DeepSeq.deepseq (_ParseTreeFileGraph'path x__) - (Control.DeepSeq.deepseq (_ParseTreeFileGraph'language x__) - (Control.DeepSeq.deepseq (_ParseTreeFileGraph'vertices x__) - (Control.DeepSeq.deepseq (_ParseTreeFileGraph'edges x__) - (Control.DeepSeq.deepseq (_ParseTreeFileGraph'errors x__) (())))))) + = (\ x__ -> + Control.DeepSeq.deepseq (_ParseTreeFileGraph'_unknownFields x__) + (Control.DeepSeq.deepseq (_ParseTreeFileGraph'path x__) + (Control.DeepSeq.deepseq (_ParseTreeFileGraph'language x__) + (Control.DeepSeq.deepseq (_ParseTreeFileGraph'vertices x__) + (Control.DeepSeq.deepseq (_ParseTreeFileGraph'edges x__) + (Control.DeepSeq.deepseq (_ParseTreeFileGraph'errors x__) + (()))))))) {- | Fields : * 'Proto.Semantic_Fields.files' @:: Lens' ParseTreeGraphResponse [ParseTreeFileGraph]@ + * 'Proto.Semantic_Fields.vec'files' @:: Lens' ParseTreeGraphResponse + (Data.Vector.Vector ParseTreeFileGraph)@ -} data ParseTreeGraphResponse = ParseTreeGraphResponse{_ParseTreeGraphResponse'files - :: ![ParseTreeFileGraph], + :: !(Data.Vector.Vector ParseTreeFileGraph), _ParseTreeGraphResponse'_unknownFields :: !Data.ProtoLens.FieldSet} deriving (Prelude.Eq, Prelude.Ord) @@ -1469,14 +3079,24 @@ instance Prelude.Show ParseTreeGraphResponse where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' ParseTreeGraphResponse "files" +instance Data.ProtoLens.Field.HasField ParseTreeGraphResponse + "files" ([ParseTreeFileGraph]) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _ParseTreeGraphResponse'files - (\ x__ y__ -> x__{_ParseTreeGraphResponse'files = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _ParseTreeGraphResponse'files + (\ x__ y__ -> x__{_ParseTreeGraphResponse'files = y__})) + Prelude.. + Lens.Family2.Unchecked.lens Data.Vector.Generic.toList + (\ _ y__ -> Data.Vector.Generic.fromList y__) +instance Data.ProtoLens.Field.HasField ParseTreeGraphResponse + "vec'files" + (Data.Vector.Vector ParseTreeFileGraph) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _ParseTreeGraphResponse'files + (\ x__ y__ -> x__{_ParseTreeGraphResponse'files = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message ParseTreeGraphResponse where messageName _ = Data.Text.pack "github.semantic.ParseTreeGraphResponse" @@ -1486,8 +3106,7 @@ instance Data.ProtoLens.Message ParseTreeGraphResponse where (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor ParseTreeFileGraph) (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "files"))) + (Data.ProtoLens.Field.field @"files")) :: Data.ProtoLens.FieldDescriptor ParseTreeGraphResponse in Data.Map.fromList [(Data.ProtoLens.Tag 1, files__field_descriptor)] @@ -1496,20 +3115,86 @@ instance Data.ProtoLens.Message ParseTreeGraphResponse where _ParseTreeGraphResponse'_unknownFields (\ x__ y__ -> x__{_ParseTreeGraphResponse'_unknownFields = y__}) defMessage - = ParseTreeGraphResponse{_ParseTreeGraphResponse'files = [], + = ParseTreeGraphResponse{_ParseTreeGraphResponse'files = + Data.Vector.Generic.empty, _ParseTreeGraphResponse'_unknownFields = ([])} + parseMessage + = let loop :: + ParseTreeGraphResponse -> + Data.ProtoLens.Encoding.Growing.Growing Data.Vector.Vector + Data.ProtoLens.Encoding.Growing.RealWorld + ParseTreeFileGraph + -> Data.ProtoLens.Encoding.Bytes.Parser ParseTreeGraphResponse + loop x mutable'files + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do frozen'files <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.unsafeFreeze + mutable'files) + let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + (Lens.Family2.set (Data.ProtoLens.Field.field @"vec'files") + frozen'files + x)) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 10 -> do !y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "files" + v <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.append + mutable'files + y) + loop x v + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + mutable'files + in + (do mutable'files <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + Data.ProtoLens.Encoding.Growing.new + loop Data.ProtoLens.defMessage mutable'files) + Data.ProtoLens.Encoding.Bytes. "ParseTreeGraphResponse" + buildMessage + = (\ _x -> + (Data.ProtoLens.Encoding.Bytes.foldMapBuilder + (\ _v -> + (Data.ProtoLens.Encoding.Bytes.putVarInt 10) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + (Lens.Family2.view (Data.ProtoLens.Field.field @"vec'files") _x)) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData ParseTreeGraphResponse where rnf - = \ x__ -> - Control.DeepSeq.deepseq - (_ParseTreeGraphResponse'_unknownFields x__) - (Control.DeepSeq.deepseq (_ParseTreeGraphResponse'files x__) (())) + = (\ x__ -> + Control.DeepSeq.deepseq + (_ParseTreeGraphResponse'_unknownFields x__) + (Control.DeepSeq.deepseq (_ParseTreeGraphResponse'files x__) (()))) {- | Fields : * 'Proto.Semantic_Fields.blobs' @:: Lens' ParseTreeRequest [Blob]@ + * 'Proto.Semantic_Fields.vec'blobs' @:: Lens' ParseTreeRequest (Data.Vector.Vector Blob)@ -} data ParseTreeRequest = ParseTreeRequest{_ParseTreeRequest'blobs :: - ![Blob], + !(Data.Vector.Vector Blob), _ParseTreeRequest'_unknownFields :: !Data.ProtoLens.FieldSet} deriving (Prelude.Eq, Prelude.Ord) @@ -1518,13 +3203,22 @@ instance Prelude.Show ParseTreeRequest where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' ParseTreeRequest "blobs" ([Blob]) +instance Data.ProtoLens.Field.HasField ParseTreeRequest "blobs" + ([Blob]) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _ParseTreeRequest'blobs - (\ x__ y__ -> x__{_ParseTreeRequest'blobs = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _ParseTreeRequest'blobs + (\ x__ y__ -> x__{_ParseTreeRequest'blobs = y__})) + Prelude.. + Lens.Family2.Unchecked.lens Data.Vector.Generic.toList + (\ _ y__ -> Data.Vector.Generic.fromList y__) +instance Data.ProtoLens.Field.HasField ParseTreeRequest "vec'blobs" + (Data.Vector.Vector Blob) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _ParseTreeRequest'blobs + (\ x__ y__ -> x__{_ParseTreeRequest'blobs = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message ParseTreeRequest where messageName _ = Data.Text.pack "github.semantic.ParseTreeRequest" fieldsByTag @@ -1533,8 +3227,7 @@ instance Data.ProtoLens.Message ParseTreeRequest where (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor Blob) (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "blobs"))) + (Data.ProtoLens.Field.field @"blobs")) :: Data.ProtoLens.FieldDescriptor ParseTreeRequest in Data.Map.fromList [(Data.ProtoLens.Tag 1, blobs__field_descriptor)] @@ -1542,19 +3235,85 @@ instance Data.ProtoLens.Message ParseTreeRequest where = Lens.Family2.Unchecked.lens _ParseTreeRequest'_unknownFields (\ x__ y__ -> x__{_ParseTreeRequest'_unknownFields = y__}) defMessage - = ParseTreeRequest{_ParseTreeRequest'blobs = [], + = ParseTreeRequest{_ParseTreeRequest'blobs = + Data.Vector.Generic.empty, _ParseTreeRequest'_unknownFields = ([])} + parseMessage + = let loop :: + ParseTreeRequest -> + Data.ProtoLens.Encoding.Growing.Growing Data.Vector.Vector + Data.ProtoLens.Encoding.Growing.RealWorld + Blob + -> Data.ProtoLens.Encoding.Bytes.Parser ParseTreeRequest + loop x mutable'blobs + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do frozen'blobs <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.unsafeFreeze + mutable'blobs) + let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + (Lens.Family2.set (Data.ProtoLens.Field.field @"vec'blobs") + frozen'blobs + x)) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 10 -> do !y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "blobs" + v <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.append + mutable'blobs + y) + loop x v + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + mutable'blobs + in + (do mutable'blobs <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + Data.ProtoLens.Encoding.Growing.new + loop Data.ProtoLens.defMessage mutable'blobs) + Data.ProtoLens.Encoding.Bytes. "ParseTreeRequest" + buildMessage + = (\ _x -> + (Data.ProtoLens.Encoding.Bytes.foldMapBuilder + (\ _v -> + (Data.ProtoLens.Encoding.Bytes.putVarInt 10) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + (Lens.Family2.view (Data.ProtoLens.Field.field @"vec'blobs") _x)) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData ParseTreeRequest where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_ParseTreeRequest'_unknownFields x__) - (Control.DeepSeq.deepseq (_ParseTreeRequest'blobs x__) (())) + = (\ x__ -> + Control.DeepSeq.deepseq (_ParseTreeRequest'_unknownFields x__) + (Control.DeepSeq.deepseq (_ParseTreeRequest'blobs x__) (()))) {- | Fields : * 'Proto.Semantic_Fields.files' @:: Lens' ParseTreeSymbolResponse [File]@ + * 'Proto.Semantic_Fields.vec'files' @:: Lens' ParseTreeSymbolResponse (Data.Vector.Vector File)@ -} data ParseTreeSymbolResponse = ParseTreeSymbolResponse{_ParseTreeSymbolResponse'files - :: ![File], + :: !(Data.Vector.Vector File), _ParseTreeSymbolResponse'_unknownFields :: !Data.ProtoLens.FieldSet} deriving (Prelude.Eq, Prelude.Ord) @@ -1563,14 +3322,24 @@ instance Prelude.Show ParseTreeSymbolResponse where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' ParseTreeSymbolResponse "files" +instance Data.ProtoLens.Field.HasField ParseTreeSymbolResponse + "files" ([File]) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _ParseTreeSymbolResponse'files - (\ x__ y__ -> x__{_ParseTreeSymbolResponse'files = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _ParseTreeSymbolResponse'files + (\ x__ y__ -> x__{_ParseTreeSymbolResponse'files = y__})) + Prelude.. + Lens.Family2.Unchecked.lens Data.Vector.Generic.toList + (\ _ y__ -> Data.Vector.Generic.fromList y__) +instance Data.ProtoLens.Field.HasField ParseTreeSymbolResponse + "vec'files" + (Data.Vector.Vector File) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _ParseTreeSymbolResponse'files + (\ x__ y__ -> x__{_ParseTreeSymbolResponse'files = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message ParseTreeSymbolResponse where messageName _ = Data.Text.pack "github.semantic.ParseTreeSymbolResponse" @@ -1580,8 +3349,7 @@ instance Data.ProtoLens.Message ParseTreeSymbolResponse where (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor File) (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "files"))) + (Data.ProtoLens.Field.field @"files")) :: Data.ProtoLens.FieldDescriptor ParseTreeSymbolResponse in Data.Map.fromList [(Data.ProtoLens.Tag 1, files__field_descriptor)] @@ -1590,14 +3358,80 @@ instance Data.ProtoLens.Message ParseTreeSymbolResponse where _ParseTreeSymbolResponse'_unknownFields (\ x__ y__ -> x__{_ParseTreeSymbolResponse'_unknownFields = y__}) defMessage - = ParseTreeSymbolResponse{_ParseTreeSymbolResponse'files = [], + = ParseTreeSymbolResponse{_ParseTreeSymbolResponse'files = + Data.Vector.Generic.empty, _ParseTreeSymbolResponse'_unknownFields = ([])} + parseMessage + = let loop :: + ParseTreeSymbolResponse -> + Data.ProtoLens.Encoding.Growing.Growing Data.Vector.Vector + Data.ProtoLens.Encoding.Growing.RealWorld + File + -> Data.ProtoLens.Encoding.Bytes.Parser ParseTreeSymbolResponse + loop x mutable'files + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do frozen'files <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.unsafeFreeze + mutable'files) + let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + (Lens.Family2.set (Data.ProtoLens.Field.field @"vec'files") + frozen'files + x)) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 10 -> do !y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "files" + v <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.append + mutable'files + y) + loop x v + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + mutable'files + in + (do mutable'files <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + Data.ProtoLens.Encoding.Growing.new + loop Data.ProtoLens.defMessage mutable'files) + Data.ProtoLens.Encoding.Bytes. "ParseTreeSymbolResponse" + buildMessage + = (\ _x -> + (Data.ProtoLens.Encoding.Bytes.foldMapBuilder + (\ _v -> + (Data.ProtoLens.Encoding.Bytes.putVarInt 10) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + (Lens.Family2.view (Data.ProtoLens.Field.field @"vec'files") _x)) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData ParseTreeSymbolResponse where rnf - = \ x__ -> - Control.DeepSeq.deepseq - (_ParseTreeSymbolResponse'_unknownFields x__) - (Control.DeepSeq.deepseq (_ParseTreeSymbolResponse'files x__) (())) + = (\ x__ -> + Control.DeepSeq.deepseq + (_ParseTreeSymbolResponse'_unknownFields x__) + (Control.DeepSeq.deepseq (_ParseTreeSymbolResponse'files x__) + (()))) {- | Fields : * 'Proto.Semantic_Fields.service' @:: Lens' PingRequest Data.Text.Text@ @@ -1611,14 +3445,13 @@ instance Prelude.Show PingRequest where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' PingRequest "service" +instance Data.ProtoLens.Field.HasField PingRequest "service" (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _PingRequest'service - (\ x__ y__ -> x__{_PingRequest'service = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _PingRequest'service + (\ x__ y__ -> x__{_PingRequest'service = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message PingRequest where messageName _ = Data.Text.pack "github.semantic.PingRequest" fieldsByTag @@ -1627,8 +3460,7 @@ instance Data.ProtoLens.Message PingRequest where (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "service"))) + (Data.ProtoLens.Field.field @"service")) :: Data.ProtoLens.FieldDescriptor PingRequest in Data.Map.fromList @@ -1639,11 +3471,68 @@ instance Data.ProtoLens.Message PingRequest where defMessage = PingRequest{_PingRequest'service = Data.ProtoLens.fieldDefault, _PingRequest'_unknownFields = ([])} + parseMessage + = let loop :: + PingRequest -> Data.ProtoLens.Encoding.Bytes.Parser PingRequest + loop x + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + x) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 10 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "service" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"service") + y + x) + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + in + (do loop Data.ProtoLens.defMessage) + Data.ProtoLens.Encoding.Bytes. "PingRequest" + buildMessage + = (\ _x -> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"service") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 10) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData PingRequest where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_PingRequest'_unknownFields x__) - (Control.DeepSeq.deepseq (_PingRequest'service x__) (())) + = (\ x__ -> + Control.DeepSeq.deepseq (_PingRequest'_unknownFields x__) + (Control.DeepSeq.deepseq (_PingRequest'service x__) (()))) {- | Fields : * 'Proto.Semantic_Fields.status' @:: Lens' PingResponse Data.Text.Text@ @@ -1663,37 +3552,34 @@ instance Prelude.Show PingResponse where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' PingResponse "status" +instance Data.ProtoLens.Field.HasField PingResponse "status" (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _PingResponse'status - (\ x__ y__ -> x__{_PingResponse'status = y__})) - Prelude.id -instance Lens.Labels.HasLens' PingResponse "hostname" + fieldOf _ + = (Lens.Family2.Unchecked.lens _PingResponse'status + (\ x__ y__ -> x__{_PingResponse'status = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField PingResponse "hostname" (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _PingResponse'hostname - (\ x__ y__ -> x__{_PingResponse'hostname = y__})) - Prelude.id -instance Lens.Labels.HasLens' PingResponse "timestamp" + fieldOf _ + = (Lens.Family2.Unchecked.lens _PingResponse'hostname + (\ x__ y__ -> x__{_PingResponse'hostname = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField PingResponse "timestamp" (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _PingResponse'timestamp - (\ x__ y__ -> x__{_PingResponse'timestamp = y__})) - Prelude.id -instance Lens.Labels.HasLens' PingResponse "sha" (Data.Text.Text) + fieldOf _ + = (Lens.Family2.Unchecked.lens _PingResponse'timestamp + (\ x__ y__ -> x__{_PingResponse'timestamp = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField PingResponse "sha" + (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _PingResponse'sha - (\ x__ y__ -> x__{_PingResponse'sha = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _PingResponse'sha + (\ x__ y__ -> x__{_PingResponse'sha = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message PingResponse where messageName _ = Data.Text.pack "github.semantic.PingResponse" fieldsByTag @@ -1702,32 +3588,28 @@ instance Data.ProtoLens.Message PingResponse where (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "status"))) + (Data.ProtoLens.Field.field @"status")) :: Data.ProtoLens.FieldDescriptor PingResponse hostname__field_descriptor = Data.ProtoLens.FieldDescriptor "hostname" (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "hostname"))) + (Data.ProtoLens.Field.field @"hostname")) :: Data.ProtoLens.FieldDescriptor PingResponse timestamp__field_descriptor = Data.ProtoLens.FieldDescriptor "timestamp" (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "timestamp"))) + (Data.ProtoLens.Field.field @"timestamp")) :: Data.ProtoLens.FieldDescriptor PingResponse sha__field_descriptor = Data.ProtoLens.FieldDescriptor "sha" (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "sha"))) + (Data.ProtoLens.Field.field @"sha")) :: Data.ProtoLens.FieldDescriptor PingResponse in Data.Map.fromList @@ -1744,14 +3626,149 @@ instance Data.ProtoLens.Message PingResponse where _PingResponse'timestamp = Data.ProtoLens.fieldDefault, _PingResponse'sha = Data.ProtoLens.fieldDefault, _PingResponse'_unknownFields = ([])} + parseMessage + = let loop :: + PingResponse -> Data.ProtoLens.Encoding.Bytes.Parser PingResponse + loop x + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + x) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 10 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "status" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"status") + y + x) + 18 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "hostname" + loop + (Lens.Family2.set + (Data.ProtoLens.Field.field @"hostname") + y + x) + 26 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "timestamp" + loop + (Lens.Family2.set + (Data.ProtoLens.Field.field @"timestamp") + y + x) + 34 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "sha" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"sha") y + x) + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + in + (do loop Data.ProtoLens.defMessage) + Data.ProtoLens.Encoding.Bytes. "PingResponse" + buildMessage + = (\ _x -> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"status") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 10) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"hostname") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 18) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"timestamp") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 26) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + (let _v = Lens.Family2.view (Data.ProtoLens.Field.field @"sha") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 34) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData PingResponse where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_PingResponse'_unknownFields x__) - (Control.DeepSeq.deepseq (_PingResponse'status x__) - (Control.DeepSeq.deepseq (_PingResponse'hostname x__) - (Control.DeepSeq.deepseq (_PingResponse'timestamp x__) - (Control.DeepSeq.deepseq (_PingResponse'sha x__) (()))))) + = (\ x__ -> + Control.DeepSeq.deepseq (_PingResponse'_unknownFields x__) + (Control.DeepSeq.deepseq (_PingResponse'status x__) + (Control.DeepSeq.deepseq (_PingResponse'hostname x__) + (Control.DeepSeq.deepseq (_PingResponse'timestamp x__) + (Control.DeepSeq.deepseq (_PingResponse'sha x__) (())))))) {- | Fields : * 'Proto.Semantic_Fields.line' @:: Lens' Position Data.Int.Int32@ @@ -1766,20 +3783,20 @@ instance Prelude.Show Position where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' Position "line" (Data.Int.Int32) +instance Data.ProtoLens.Field.HasField Position "line" + (Data.Int.Int32) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _Position'line - (\ x__ y__ -> x__{_Position'line = y__})) - Prelude.id -instance Lens.Labels.HasLens' Position "column" (Data.Int.Int32) + fieldOf _ + = (Lens.Family2.Unchecked.lens _Position'line + (\ x__ y__ -> x__{_Position'line = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField Position "column" + (Data.Int.Int32) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _Position'column - (\ x__ y__ -> x__{_Position'column = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _Position'column + (\ x__ y__ -> x__{_Position'column = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message Position where messageName _ = Data.Text.pack "github.semantic.Position" fieldsByTag @@ -1788,16 +3805,14 @@ instance Data.ProtoLens.Message Position where (Data.ProtoLens.ScalarField Data.ProtoLens.Int32Field :: Data.ProtoLens.FieldTypeDescriptor Data.Int.Int32) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "line"))) + (Data.ProtoLens.Field.field @"line")) :: Data.ProtoLens.FieldDescriptor Position column__field_descriptor = Data.ProtoLens.FieldDescriptor "column" (Data.ProtoLens.ScalarField Data.ProtoLens.Int32Field :: Data.ProtoLens.FieldTypeDescriptor Data.Int.Int32) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "column"))) + (Data.ProtoLens.Field.field @"column")) :: Data.ProtoLens.FieldDescriptor Position in Data.Map.fromList @@ -1810,12 +3825,75 @@ instance Data.ProtoLens.Message Position where = Position{_Position'line = Data.ProtoLens.fieldDefault, _Position'column = Data.ProtoLens.fieldDefault, _Position'_unknownFields = ([])} + parseMessage + = let loop :: + Position -> Data.ProtoLens.Encoding.Bytes.Parser Position + loop x + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + x) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 8 -> do y <- (Prelude.fmap Prelude.fromIntegral + Data.ProtoLens.Encoding.Bytes.getVarInt) + Data.ProtoLens.Encoding.Bytes. "line" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"line") y + x) + 16 -> do y <- (Prelude.fmap Prelude.fromIntegral + Data.ProtoLens.Encoding.Bytes.getVarInt) + Data.ProtoLens.Encoding.Bytes. "column" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"column") + y + x) + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + in + (do loop Data.ProtoLens.defMessage) + Data.ProtoLens.Encoding.Bytes. "Position" + buildMessage + = (\ _x -> + (let _v = Lens.Family2.view (Data.ProtoLens.Field.field @"line") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 8) Data.Monoid.<> + ((Data.ProtoLens.Encoding.Bytes.putVarInt) Prelude.. + Prelude.fromIntegral) + _v) + Data.Monoid.<> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"column") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 16) Data.Monoid.<> + ((Data.ProtoLens.Encoding.Bytes.putVarInt) Prelude.. + Prelude.fromIntegral) + _v) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData Position where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_Position'_unknownFields x__) - (Control.DeepSeq.deepseq (_Position'line x__) - (Control.DeepSeq.deepseq (_Position'column x__) (()))) + = (\ x__ -> + Control.DeepSeq.deepseq (_Position'_unknownFields x__) + (Control.DeepSeq.deepseq (_Position'line x__) + (Control.DeepSeq.deepseq (_Position'column x__) (())))) {- | Fields : * 'Proto.Semantic_Fields.beforeTerm' @:: Lens' ReplacedTerm Data.Text.Text@ @@ -1837,51 +3915,50 @@ instance Prelude.Show ReplacedTerm where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' ReplacedTerm "beforeTerm" +instance Data.ProtoLens.Field.HasField ReplacedTerm "beforeTerm" (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _ReplacedTerm'beforeTerm - (\ x__ y__ -> x__{_ReplacedTerm'beforeTerm = y__})) - Prelude.id -instance Lens.Labels.HasLens' ReplacedTerm "beforeSpan" (Span) - where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _ReplacedTerm'beforeSpan - (\ x__ y__ -> x__{_ReplacedTerm'beforeSpan = y__})) - (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) -instance Lens.Labels.HasLens' ReplacedTerm "maybe'beforeSpan" + fieldOf _ + = (Lens.Family2.Unchecked.lens _ReplacedTerm'beforeTerm + (\ x__ y__ -> x__{_ReplacedTerm'beforeTerm = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField ReplacedTerm "beforeSpan" + (Span) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _ReplacedTerm'beforeSpan + (\ x__ y__ -> x__{_ReplacedTerm'beforeSpan = y__})) + Prelude.. Data.ProtoLens.maybeLens Data.ProtoLens.defMessage +instance Data.ProtoLens.Field.HasField ReplacedTerm + "maybe'beforeSpan" (Prelude.Maybe Span) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _ReplacedTerm'beforeSpan - (\ x__ y__ -> x__{_ReplacedTerm'beforeSpan = y__})) - Prelude.id -instance Lens.Labels.HasLens' ReplacedTerm "afterTerm" + fieldOf _ + = (Lens.Family2.Unchecked.lens _ReplacedTerm'beforeSpan + (\ x__ y__ -> x__{_ReplacedTerm'beforeSpan = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField ReplacedTerm "afterTerm" (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _ReplacedTerm'afterTerm - (\ x__ y__ -> x__{_ReplacedTerm'afterTerm = y__})) - Prelude.id -instance Lens.Labels.HasLens' ReplacedTerm "afterSpan" (Span) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _ReplacedTerm'afterSpan - (\ x__ y__ -> x__{_ReplacedTerm'afterSpan = y__})) - (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) -instance Lens.Labels.HasLens' ReplacedTerm "maybe'afterSpan" + fieldOf _ + = (Lens.Family2.Unchecked.lens _ReplacedTerm'afterTerm + (\ x__ y__ -> x__{_ReplacedTerm'afterTerm = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField ReplacedTerm "afterSpan" + (Span) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _ReplacedTerm'afterSpan + (\ x__ y__ -> x__{_ReplacedTerm'afterSpan = y__})) + Prelude.. Data.ProtoLens.maybeLens Data.ProtoLens.defMessage +instance Data.ProtoLens.Field.HasField ReplacedTerm + "maybe'afterSpan" (Prelude.Maybe Span) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _ReplacedTerm'afterSpan - (\ x__ y__ -> x__{_ReplacedTerm'afterSpan = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _ReplacedTerm'afterSpan + (\ x__ y__ -> x__{_ReplacedTerm'afterSpan = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message ReplacedTerm where messageName _ = Data.Text.pack "github.semantic.ReplacedTerm" fieldsByTag @@ -1890,32 +3967,28 @@ instance Data.ProtoLens.Message ReplacedTerm where (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "beforeTerm"))) + (Data.ProtoLens.Field.field @"beforeTerm")) :: Data.ProtoLens.FieldDescriptor ReplacedTerm beforeSpan__field_descriptor = Data.ProtoLens.FieldDescriptor "before_span" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor Span) (Data.ProtoLens.OptionalField - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'beforeSpan"))) + (Data.ProtoLens.Field.field @"maybe'beforeSpan")) :: Data.ProtoLens.FieldDescriptor ReplacedTerm afterTerm__field_descriptor = Data.ProtoLens.FieldDescriptor "after_term" (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "afterTerm"))) + (Data.ProtoLens.Field.field @"afterTerm")) :: Data.ProtoLens.FieldDescriptor ReplacedTerm afterSpan__field_descriptor = Data.ProtoLens.FieldDescriptor "after_span" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor Span) (Data.ProtoLens.OptionalField - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'afterSpan"))) + (Data.ProtoLens.Field.field @"maybe'afterSpan")) :: Data.ProtoLens.FieldDescriptor ReplacedTerm in Data.Map.fromList @@ -1933,14 +4006,151 @@ instance Data.ProtoLens.Message ReplacedTerm where _ReplacedTerm'afterTerm = Data.ProtoLens.fieldDefault, _ReplacedTerm'afterSpan = Prelude.Nothing, _ReplacedTerm'_unknownFields = ([])} + parseMessage + = let loop :: + ReplacedTerm -> Data.ProtoLens.Encoding.Bytes.Parser ReplacedTerm + loop x + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + x) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 10 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "before_term" + loop + (Lens.Family2.set + (Data.ProtoLens.Field.field @"beforeTerm") + y + x) + 18 -> do y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "before_span" + loop + (Lens.Family2.set + (Data.ProtoLens.Field.field @"beforeSpan") + y + x) + 26 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "after_term" + loop + (Lens.Family2.set + (Data.ProtoLens.Field.field @"afterTerm") + y + x) + 34 -> do y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "after_span" + loop + (Lens.Family2.set + (Data.ProtoLens.Field.field @"afterSpan") + y + x) + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + in + (do loop Data.ProtoLens.defMessage) + Data.ProtoLens.Encoding.Bytes. "ReplacedTerm" + buildMessage + = (\ _x -> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"beforeTerm") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 10) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + (case + Lens.Family2.view (Data.ProtoLens.Field.field @"maybe'beforeSpan") + _x + of + (Prelude.Nothing) -> Data.Monoid.mempty + Prelude.Just _v -> (Data.ProtoLens.Encoding.Bytes.putVarInt 18) + Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral + (Data.ByteString.length bs))) + Data.Monoid.<> + Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + Data.Monoid.<> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"afterTerm") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 26) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + (case + Lens.Family2.view (Data.ProtoLens.Field.field @"maybe'afterSpan") + _x + of + (Prelude.Nothing) -> Data.Monoid.mempty + Prelude.Just _v -> (Data.ProtoLens.Encoding.Bytes.putVarInt 34) + Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral + (Data.ByteString.length bs))) + Data.Monoid.<> + Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData ReplacedTerm where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_ReplacedTerm'_unknownFields x__) - (Control.DeepSeq.deepseq (_ReplacedTerm'beforeTerm x__) - (Control.DeepSeq.deepseq (_ReplacedTerm'beforeSpan x__) - (Control.DeepSeq.deepseq (_ReplacedTerm'afterTerm x__) - (Control.DeepSeq.deepseq (_ReplacedTerm'afterSpan x__) (()))))) + = (\ x__ -> + Control.DeepSeq.deepseq (_ReplacedTerm'_unknownFields x__) + (Control.DeepSeq.deepseq (_ReplacedTerm'beforeTerm x__) + (Control.DeepSeq.deepseq (_ReplacedTerm'beforeSpan x__) + (Control.DeepSeq.deepseq (_ReplacedTerm'afterTerm x__) + (Control.DeepSeq.deepseq (_ReplacedTerm'afterSpan x__) (())))))) {- | Fields : * 'Proto.Semantic_Fields.start' @:: Lens' Span Position@ @@ -1957,34 +4167,31 @@ instance Prelude.Show Span where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' Span "start" (Position) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _Span'start - (\ x__ y__ -> x__{_Span'start = y__})) - (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) -instance Lens.Labels.HasLens' Span "maybe'start" +instance Data.ProtoLens.Field.HasField Span "start" (Position) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _Span'start + (\ x__ y__ -> x__{_Span'start = y__})) + Prelude.. Data.ProtoLens.maybeLens Data.ProtoLens.defMessage +instance Data.ProtoLens.Field.HasField Span "maybe'start" (Prelude.Maybe Position) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _Span'start - (\ x__ y__ -> x__{_Span'start = y__})) - Prelude.id -instance Lens.Labels.HasLens' Span "end" (Position) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _Span'end - (\ x__ y__ -> x__{_Span'end = y__})) - (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) -instance Lens.Labels.HasLens' Span "maybe'end" + fieldOf _ + = (Lens.Family2.Unchecked.lens _Span'start + (\ x__ y__ -> x__{_Span'start = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField Span "end" (Position) where + fieldOf _ + = (Lens.Family2.Unchecked.lens _Span'end + (\ x__ y__ -> x__{_Span'end = y__})) + Prelude.. Data.ProtoLens.maybeLens Data.ProtoLens.defMessage +instance Data.ProtoLens.Field.HasField Span "maybe'end" (Prelude.Maybe Position) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _Span'end - (\ x__ y__ -> x__{_Span'end = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _Span'end + (\ x__ y__ -> x__{_Span'end = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message Span where messageName _ = Data.Text.pack "github.semantic.Span" fieldsByTag @@ -1993,16 +4200,14 @@ instance Data.ProtoLens.Message Span where (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor Position) (Data.ProtoLens.OptionalField - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'start"))) + (Data.ProtoLens.Field.field @"maybe'start")) :: Data.ProtoLens.FieldDescriptor Span end__field_descriptor = Data.ProtoLens.FieldDescriptor "end" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor Position) (Data.ProtoLens.OptionalField - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'end"))) + (Data.ProtoLens.Field.field @"maybe'end")) :: Data.ProtoLens.FieldDescriptor Span in Data.Map.fromList @@ -2014,12 +4219,85 @@ instance Data.ProtoLens.Message Span where defMessage = Span{_Span'start = Prelude.Nothing, _Span'end = Prelude.Nothing, _Span'_unknownFields = ([])} + parseMessage + = let loop :: Span -> Data.ProtoLens.Encoding.Bytes.Parser Span + loop x + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + x) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 10 -> do y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "start" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"start") y + x) + 18 -> do y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "end" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"end") y + x) + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + in + (do loop Data.ProtoLens.defMessage) + Data.ProtoLens.Encoding.Bytes. "Span" + buildMessage + = (\ _x -> + (case + Lens.Family2.view (Data.ProtoLens.Field.field @"maybe'start") _x of + (Prelude.Nothing) -> Data.Monoid.mempty + Prelude.Just _v -> (Data.ProtoLens.Encoding.Bytes.putVarInt 10) + Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> + Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + Data.Monoid.<> + (case + Lens.Family2.view (Data.ProtoLens.Field.field @"maybe'end") _x of + (Prelude.Nothing) -> Data.Monoid.mempty + Prelude.Just _v -> (Data.ProtoLens.Encoding.Bytes.putVarInt 18) + Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral + (Data.ByteString.length bs))) + Data.Monoid.<> + Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData Span where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_Span'_unknownFields x__) - (Control.DeepSeq.deepseq (_Span'start x__) - (Control.DeepSeq.deepseq (_Span'end x__) (()))) + = (\ x__ -> + Control.DeepSeq.deepseq (_Span'_unknownFields x__) + (Control.DeepSeq.deepseq (_Span'start x__) + (Control.DeepSeq.deepseq (_Span'end x__) (())))) {- | Fields : * 'Proto.Semantic_Fields.symbol' @:: Lens' Symbol Data.Text.Text@ @@ -2041,53 +4319,52 @@ instance Prelude.Show Symbol where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' Symbol "symbol" (Data.Text.Text) +instance Data.ProtoLens.Field.HasField Symbol "symbol" + (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _Symbol'symbol - (\ x__ y__ -> x__{_Symbol'symbol = y__})) - Prelude.id -instance Lens.Labels.HasLens' Symbol "kind" (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _Symbol'kind - (\ x__ y__ -> x__{_Symbol'kind = y__})) - Prelude.id -instance Lens.Labels.HasLens' Symbol "line" (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _Symbol'line - (\ x__ y__ -> x__{_Symbol'line = y__})) - Prelude.id -instance Lens.Labels.HasLens' Symbol "span" (Span) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _Symbol'span - (\ x__ y__ -> x__{_Symbol'span = y__})) - (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) -instance Lens.Labels.HasLens' Symbol "maybe'span" + fieldOf _ + = (Lens.Family2.Unchecked.lens _Symbol'symbol + (\ x__ y__ -> x__{_Symbol'symbol = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField Symbol "kind" + (Data.Text.Text) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _Symbol'kind + (\ x__ y__ -> x__{_Symbol'kind = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField Symbol "line" + (Data.Text.Text) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _Symbol'line + (\ x__ y__ -> x__{_Symbol'line = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField Symbol "span" (Span) where + fieldOf _ + = (Lens.Family2.Unchecked.lens _Symbol'span + (\ x__ y__ -> x__{_Symbol'span = y__})) + Prelude.. Data.ProtoLens.maybeLens Data.ProtoLens.defMessage +instance Data.ProtoLens.Field.HasField Symbol "maybe'span" (Prelude.Maybe Span) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _Symbol'span - (\ x__ y__ -> x__{_Symbol'span = y__})) - Prelude.id -instance Lens.Labels.HasLens' Symbol "docs" (Docstring) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _Symbol'docs - (\ x__ y__ -> x__{_Symbol'docs = y__})) - (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) -instance Lens.Labels.HasLens' Symbol "maybe'docs" + fieldOf _ + = (Lens.Family2.Unchecked.lens _Symbol'span + (\ x__ y__ -> x__{_Symbol'span = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField Symbol "docs" (Docstring) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _Symbol'docs + (\ x__ y__ -> x__{_Symbol'docs = y__})) + Prelude.. Data.ProtoLens.maybeLens Data.ProtoLens.defMessage +instance Data.ProtoLens.Field.HasField Symbol "maybe'docs" (Prelude.Maybe Docstring) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _Symbol'docs - (\ x__ y__ -> x__{_Symbol'docs = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _Symbol'docs + (\ x__ y__ -> x__{_Symbol'docs = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message Symbol where messageName _ = Data.Text.pack "github.semantic.Symbol" fieldsByTag @@ -2096,40 +4373,35 @@ instance Data.ProtoLens.Message Symbol where (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "symbol"))) + (Data.ProtoLens.Field.field @"symbol")) :: Data.ProtoLens.FieldDescriptor Symbol kind__field_descriptor = Data.ProtoLens.FieldDescriptor "kind" (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "kind"))) + (Data.ProtoLens.Field.field @"kind")) :: Data.ProtoLens.FieldDescriptor Symbol line__field_descriptor = Data.ProtoLens.FieldDescriptor "line" (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "line"))) + (Data.ProtoLens.Field.field @"line")) :: Data.ProtoLens.FieldDescriptor Symbol span__field_descriptor = Data.ProtoLens.FieldDescriptor "span" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor Span) (Data.ProtoLens.OptionalField - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'span"))) + (Data.ProtoLens.Field.field @"maybe'span")) :: Data.ProtoLens.FieldDescriptor Symbol docs__field_descriptor = Data.ProtoLens.FieldDescriptor "docs" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor Docstring) (Data.ProtoLens.OptionalField - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'docs"))) + (Data.ProtoLens.Field.field @"maybe'docs")) :: Data.ProtoLens.FieldDescriptor Symbol in Data.Map.fromList @@ -2147,15 +4419,163 @@ instance Data.ProtoLens.Message Symbol where _Symbol'line = Data.ProtoLens.fieldDefault, _Symbol'span = Prelude.Nothing, _Symbol'docs = Prelude.Nothing, _Symbol'_unknownFields = ([])} + parseMessage + = let loop :: Symbol -> Data.ProtoLens.Encoding.Bytes.Parser Symbol + loop x + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + x) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 10 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "symbol" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"symbol") + y + x) + 18 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "kind" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"kind") y + x) + 26 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "line" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"line") y + x) + 34 -> do y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "span" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"span") y + x) + 42 -> do y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "docs" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"docs") y + x) + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + in + (do loop Data.ProtoLens.defMessage) + Data.ProtoLens.Encoding.Bytes. "Symbol" + buildMessage + = (\ _x -> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"symbol") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 10) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + (let _v = Lens.Family2.view (Data.ProtoLens.Field.field @"kind") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 18) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + (let _v = Lens.Family2.view (Data.ProtoLens.Field.field @"line") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 26) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + (case + Lens.Family2.view (Data.ProtoLens.Field.field @"maybe'span") _x of + (Prelude.Nothing) -> Data.Monoid.mempty + Prelude.Just _v -> (Data.ProtoLens.Encoding.Bytes.putVarInt 34) + Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral + (Data.ByteString.length bs))) + Data.Monoid.<> + Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + Data.Monoid.<> + (case + Lens.Family2.view (Data.ProtoLens.Field.field @"maybe'docs") _x of + (Prelude.Nothing) -> Data.Monoid.mempty + Prelude.Just _v -> (Data.ProtoLens.Encoding.Bytes.putVarInt 42) + Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral + (Data.ByteString.length bs))) + Data.Monoid.<> + Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData Symbol where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_Symbol'_unknownFields x__) - (Control.DeepSeq.deepseq (_Symbol'symbol x__) - (Control.DeepSeq.deepseq (_Symbol'kind x__) - (Control.DeepSeq.deepseq (_Symbol'line x__) - (Control.DeepSeq.deepseq (_Symbol'span x__) - (Control.DeepSeq.deepseq (_Symbol'docs x__) (())))))) + = (\ x__ -> + Control.DeepSeq.deepseq (_Symbol'_unknownFields x__) + (Control.DeepSeq.deepseq (_Symbol'symbol x__) + (Control.DeepSeq.deepseq (_Symbol'kind x__) + (Control.DeepSeq.deepseq (_Symbol'line x__) + (Control.DeepSeq.deepseq (_Symbol'span x__) + (Control.DeepSeq.deepseq (_Symbol'docs x__) (()))))))) {- | Fields : * 'Proto.Semantic_Fields.category' @:: Lens' TOCSummaryChange Data.Text.Text@ @@ -2177,44 +4597,43 @@ instance Prelude.Show TOCSummaryChange where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' TOCSummaryChange "category" +instance Data.ProtoLens.Field.HasField TOCSummaryChange "category" (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _TOCSummaryChange'category - (\ x__ y__ -> x__{_TOCSummaryChange'category = y__})) - Prelude.id -instance Lens.Labels.HasLens' TOCSummaryChange "term" + fieldOf _ + = (Lens.Family2.Unchecked.lens _TOCSummaryChange'category + (\ x__ y__ -> x__{_TOCSummaryChange'category = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField TOCSummaryChange "term" (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _TOCSummaryChange'term - (\ x__ y__ -> x__{_TOCSummaryChange'term = y__})) - Prelude.id -instance Lens.Labels.HasLens' TOCSummaryChange "span" (Span) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _TOCSummaryChange'span - (\ x__ y__ -> x__{_TOCSummaryChange'span = y__})) - (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) -instance Lens.Labels.HasLens' TOCSummaryChange "maybe'span" + fieldOf _ + = (Lens.Family2.Unchecked.lens _TOCSummaryChange'term + (\ x__ y__ -> x__{_TOCSummaryChange'term = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField TOCSummaryChange "span" + (Span) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _TOCSummaryChange'span + (\ x__ y__ -> x__{_TOCSummaryChange'span = y__})) + Prelude.. Data.ProtoLens.maybeLens Data.ProtoLens.defMessage +instance Data.ProtoLens.Field.HasField TOCSummaryChange + "maybe'span" (Prelude.Maybe Span) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _TOCSummaryChange'span - (\ x__ y__ -> x__{_TOCSummaryChange'span = y__})) - Prelude.id -instance Lens.Labels.HasLens' TOCSummaryChange "changeType" + fieldOf _ + = (Lens.Family2.Unchecked.lens _TOCSummaryChange'span + (\ x__ y__ -> x__{_TOCSummaryChange'span = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField TOCSummaryChange + "changeType" (ChangeType) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _TOCSummaryChange'changeType - (\ x__ y__ -> x__{_TOCSummaryChange'changeType = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _TOCSummaryChange'changeType + (\ x__ y__ -> x__{_TOCSummaryChange'changeType = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message TOCSummaryChange where messageName _ = Data.Text.pack "github.semantic.TOCSummaryChange" fieldsByTag @@ -2223,32 +4642,28 @@ instance Data.ProtoLens.Message TOCSummaryChange where (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "category"))) + (Data.ProtoLens.Field.field @"category")) :: Data.ProtoLens.FieldDescriptor TOCSummaryChange term__field_descriptor = Data.ProtoLens.FieldDescriptor "term" (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "term"))) + (Data.ProtoLens.Field.field @"term")) :: Data.ProtoLens.FieldDescriptor TOCSummaryChange span__field_descriptor = Data.ProtoLens.FieldDescriptor "span" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor Span) (Data.ProtoLens.OptionalField - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'span"))) + (Data.ProtoLens.Field.field @"maybe'span")) :: Data.ProtoLens.FieldDescriptor TOCSummaryChange changeType__field_descriptor = Data.ProtoLens.FieldDescriptor "change_type" (Data.ProtoLens.ScalarField Data.ProtoLens.EnumField :: Data.ProtoLens.FieldTypeDescriptor ChangeType) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "changeType"))) + (Data.ProtoLens.Field.field @"changeType")) :: Data.ProtoLens.FieldDescriptor TOCSummaryChange in Data.Map.fromList @@ -2266,15 +4681,140 @@ instance Data.ProtoLens.Message TOCSummaryChange where _TOCSummaryChange'span = Prelude.Nothing, _TOCSummaryChange'changeType = Data.ProtoLens.fieldDefault, _TOCSummaryChange'_unknownFields = ([])} + parseMessage + = let loop :: + TOCSummaryChange -> + Data.ProtoLens.Encoding.Bytes.Parser TOCSummaryChange + loop x + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + x) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 10 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "category" + loop + (Lens.Family2.set + (Data.ProtoLens.Field.field @"category") + y + x) + 18 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "term" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"term") y + x) + 26 -> do y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "span" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"span") y + x) + 32 -> do y <- (Prelude.fmap Prelude.toEnum + (Prelude.fmap Prelude.fromIntegral + Data.ProtoLens.Encoding.Bytes.getVarInt)) + Data.ProtoLens.Encoding.Bytes. "change_type" + loop + (Lens.Family2.set + (Data.ProtoLens.Field.field @"changeType") + y + x) + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + in + (do loop Data.ProtoLens.defMessage) + Data.ProtoLens.Encoding.Bytes. "TOCSummaryChange" + buildMessage + = (\ _x -> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"category") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 10) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + (let _v = Lens.Family2.view (Data.ProtoLens.Field.field @"term") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 18) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + (case + Lens.Family2.view (Data.ProtoLens.Field.field @"maybe'span") _x of + (Prelude.Nothing) -> Data.Monoid.mempty + Prelude.Just _v -> (Data.ProtoLens.Encoding.Bytes.putVarInt 26) + Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral + (Data.ByteString.length bs))) + Data.Monoid.<> + Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + Data.Monoid.<> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"changeType") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 32) Data.Monoid.<> + (((Data.ProtoLens.Encoding.Bytes.putVarInt) Prelude.. + Prelude.fromIntegral) + Prelude.. Prelude.fromEnum) + _v) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData TOCSummaryChange where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_TOCSummaryChange'_unknownFields x__) - (Control.DeepSeq.deepseq (_TOCSummaryChange'category x__) - (Control.DeepSeq.deepseq (_TOCSummaryChange'term x__) - (Control.DeepSeq.deepseq (_TOCSummaryChange'span x__) - (Control.DeepSeq.deepseq (_TOCSummaryChange'changeType x__) - (()))))) + = (\ x__ -> + Control.DeepSeq.deepseq (_TOCSummaryChange'_unknownFields x__) + (Control.DeepSeq.deepseq (_TOCSummaryChange'category x__) + (Control.DeepSeq.deepseq (_TOCSummaryChange'term x__) + (Control.DeepSeq.deepseq (_TOCSummaryChange'span x__) + (Control.DeepSeq.deepseq (_TOCSummaryChange'changeType x__) + (())))))) {- | Fields : * 'Proto.Semantic_Fields.error' @:: Lens' TOCSummaryError Data.Text.Text@ @@ -2291,28 +4831,27 @@ instance Prelude.Show TOCSummaryError where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' TOCSummaryError "error" +instance Data.ProtoLens.Field.HasField TOCSummaryError "error" (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _TOCSummaryError'error - (\ x__ y__ -> x__{_TOCSummaryError'error = y__})) - Prelude.id -instance Lens.Labels.HasLens' TOCSummaryError "span" (Span) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _TOCSummaryError'span - (\ x__ y__ -> x__{_TOCSummaryError'span = y__})) - (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) -instance Lens.Labels.HasLens' TOCSummaryError "maybe'span" + fieldOf _ + = (Lens.Family2.Unchecked.lens _TOCSummaryError'error + (\ x__ y__ -> x__{_TOCSummaryError'error = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField TOCSummaryError "span" + (Span) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _TOCSummaryError'span + (\ x__ y__ -> x__{_TOCSummaryError'span = y__})) + Prelude.. Data.ProtoLens.maybeLens Data.ProtoLens.defMessage +instance Data.ProtoLens.Field.HasField TOCSummaryError "maybe'span" (Prelude.Maybe Span) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _TOCSummaryError'span - (\ x__ y__ -> x__{_TOCSummaryError'span = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _TOCSummaryError'span + (\ x__ y__ -> x__{_TOCSummaryError'span = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message TOCSummaryError where messageName _ = Data.Text.pack "github.semantic.TOCSummaryError" fieldsByTag @@ -2321,16 +4860,14 @@ instance Data.ProtoLens.Message TOCSummaryError where (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "error"))) + (Data.ProtoLens.Field.field @"error")) :: Data.ProtoLens.FieldDescriptor TOCSummaryError span__field_descriptor = Data.ProtoLens.FieldDescriptor "span" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor Span) (Data.ProtoLens.OptionalField - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'span"))) + (Data.ProtoLens.Field.field @"maybe'span")) :: Data.ProtoLens.FieldDescriptor TOCSummaryError in Data.Map.fromList @@ -2344,24 +4881,107 @@ instance Data.ProtoLens.Message TOCSummaryError where Data.ProtoLens.fieldDefault, _TOCSummaryError'span = Prelude.Nothing, _TOCSummaryError'_unknownFields = ([])} + parseMessage + = let loop :: + TOCSummaryError -> + Data.ProtoLens.Encoding.Bytes.Parser TOCSummaryError + loop x + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + x) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 10 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "error" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"error") y + x) + 18 -> do y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "span" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"span") y + x) + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + in + (do loop Data.ProtoLens.defMessage) + Data.ProtoLens.Encoding.Bytes. "TOCSummaryError" + buildMessage + = (\ _x -> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"error") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 10) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + (case + Lens.Family2.view (Data.ProtoLens.Field.field @"maybe'span") _x of + (Prelude.Nothing) -> Data.Monoid.mempty + Prelude.Just _v -> (Data.ProtoLens.Encoding.Bytes.putVarInt 18) + Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral + (Data.ByteString.length bs))) + Data.Monoid.<> + Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData TOCSummaryError where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_TOCSummaryError'_unknownFields x__) - (Control.DeepSeq.deepseq (_TOCSummaryError'error x__) - (Control.DeepSeq.deepseq (_TOCSummaryError'span x__) (()))) + = (\ x__ -> + Control.DeepSeq.deepseq (_TOCSummaryError'_unknownFields x__) + (Control.DeepSeq.deepseq (_TOCSummaryError'error x__) + (Control.DeepSeq.deepseq (_TOCSummaryError'span x__) (())))) {- | Fields : * 'Proto.Semantic_Fields.path' @:: Lens' TOCSummaryFile Data.Text.Text@ * 'Proto.Semantic_Fields.language' @:: Lens' TOCSummaryFile Data.Text.Text@ * 'Proto.Semantic_Fields.changes' @:: Lens' TOCSummaryFile [TOCSummaryChange]@ + * 'Proto.Semantic_Fields.vec'changes' @:: Lens' TOCSummaryFile (Data.Vector.Vector TOCSummaryChange)@ * 'Proto.Semantic_Fields.errors' @:: Lens' TOCSummaryFile [TOCSummaryError]@ + * 'Proto.Semantic_Fields.vec'errors' @:: Lens' TOCSummaryFile (Data.Vector.Vector TOCSummaryError)@ -} data TOCSummaryFile = TOCSummaryFile{_TOCSummaryFile'path :: !Data.Text.Text, _TOCSummaryFile'language :: !Data.Text.Text, - _TOCSummaryFile'changes :: ![TOCSummaryChange], - _TOCSummaryFile'errors :: ![TOCSummaryError], + _TOCSummaryFile'changes :: + !(Data.Vector.Vector TOCSummaryChange), + _TOCSummaryFile'errors :: + !(Data.Vector.Vector TOCSummaryError), _TOCSummaryFile'_unknownFields :: !Data.ProtoLens.FieldSet} deriving (Prelude.Eq, Prelude.Ord) instance Prelude.Show TOCSummaryFile where @@ -2369,38 +4989,52 @@ instance Prelude.Show TOCSummaryFile where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' TOCSummaryFile "path" +instance Data.ProtoLens.Field.HasField TOCSummaryFile "path" (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _TOCSummaryFile'path - (\ x__ y__ -> x__{_TOCSummaryFile'path = y__})) - Prelude.id -instance Lens.Labels.HasLens' TOCSummaryFile "language" + fieldOf _ + = (Lens.Family2.Unchecked.lens _TOCSummaryFile'path + (\ x__ y__ -> x__{_TOCSummaryFile'path = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField TOCSummaryFile "language" (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _TOCSummaryFile'language - (\ x__ y__ -> x__{_TOCSummaryFile'language = y__})) - Prelude.id -instance Lens.Labels.HasLens' TOCSummaryFile "changes" + fieldOf _ + = (Lens.Family2.Unchecked.lens _TOCSummaryFile'language + (\ x__ y__ -> x__{_TOCSummaryFile'language = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField TOCSummaryFile "changes" ([TOCSummaryChange]) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _TOCSummaryFile'changes - (\ x__ y__ -> x__{_TOCSummaryFile'changes = y__})) - Prelude.id -instance Lens.Labels.HasLens' TOCSummaryFile "errors" + fieldOf _ + = (Lens.Family2.Unchecked.lens _TOCSummaryFile'changes + (\ x__ y__ -> x__{_TOCSummaryFile'changes = y__})) + Prelude.. + Lens.Family2.Unchecked.lens Data.Vector.Generic.toList + (\ _ y__ -> Data.Vector.Generic.fromList y__) +instance Data.ProtoLens.Field.HasField TOCSummaryFile "vec'changes" + (Data.Vector.Vector TOCSummaryChange) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _TOCSummaryFile'changes + (\ x__ y__ -> x__{_TOCSummaryFile'changes = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField TOCSummaryFile "errors" ([TOCSummaryError]) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _TOCSummaryFile'errors - (\ x__ y__ -> x__{_TOCSummaryFile'errors = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _TOCSummaryFile'errors + (\ x__ y__ -> x__{_TOCSummaryFile'errors = y__})) + Prelude.. + Lens.Family2.Unchecked.lens Data.Vector.Generic.toList + (\ _ y__ -> Data.Vector.Generic.fromList y__) +instance Data.ProtoLens.Field.HasField TOCSummaryFile "vec'errors" + (Data.Vector.Vector TOCSummaryError) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _TOCSummaryFile'errors + (\ x__ y__ -> x__{_TOCSummaryFile'errors = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message TOCSummaryFile where messageName _ = Data.Text.pack "github.semantic.TOCSummaryFile" fieldsByTag @@ -2409,32 +5043,28 @@ instance Data.ProtoLens.Message TOCSummaryFile where (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "path"))) + (Data.ProtoLens.Field.field @"path")) :: Data.ProtoLens.FieldDescriptor TOCSummaryFile language__field_descriptor = Data.ProtoLens.FieldDescriptor "language" (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "language"))) + (Data.ProtoLens.Field.field @"language")) :: Data.ProtoLens.FieldDescriptor TOCSummaryFile changes__field_descriptor = Data.ProtoLens.FieldDescriptor "changes" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor TOCSummaryChange) (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "changes"))) + (Data.ProtoLens.Field.field @"changes")) :: Data.ProtoLens.FieldDescriptor TOCSummaryFile errors__field_descriptor = Data.ProtoLens.FieldDescriptor "errors" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor TOCSummaryError) (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "errors"))) + (Data.ProtoLens.Field.field @"errors")) :: Data.ProtoLens.FieldDescriptor TOCSummaryFile in Data.Map.fromList @@ -2449,16 +5079,169 @@ instance Data.ProtoLens.Message TOCSummaryFile where = TOCSummaryFile{_TOCSummaryFile'path = Data.ProtoLens.fieldDefault, _TOCSummaryFile'language = Data.ProtoLens.fieldDefault, - _TOCSummaryFile'changes = [], _TOCSummaryFile'errors = [], + _TOCSummaryFile'changes = Data.Vector.Generic.empty, + _TOCSummaryFile'errors = Data.Vector.Generic.empty, _TOCSummaryFile'_unknownFields = ([])} + parseMessage + = let loop :: + TOCSummaryFile -> + Data.ProtoLens.Encoding.Growing.Growing Data.Vector.Vector + Data.ProtoLens.Encoding.Growing.RealWorld + TOCSummaryChange + -> + Data.ProtoLens.Encoding.Growing.Growing Data.Vector.Vector + Data.ProtoLens.Encoding.Growing.RealWorld + TOCSummaryError + -> Data.ProtoLens.Encoding.Bytes.Parser TOCSummaryFile + loop x mutable'changes mutable'errors + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do frozen'changes <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.unsafeFreeze + mutable'changes) + frozen'errors <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.unsafeFreeze + mutable'errors) + let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + (Lens.Family2.set (Data.ProtoLens.Field.field @"vec'changes") + frozen'changes + (Lens.Family2.set (Data.ProtoLens.Field.field @"vec'errors") + frozen'errors + x))) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 10 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "path" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"path") y + x) + mutable'changes + mutable'errors + 18 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "language" + loop + (Lens.Family2.set + (Data.ProtoLens.Field.field @"language") + y + x) + mutable'changes + mutable'errors + 26 -> do !y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "changes" + v <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.append + mutable'changes + y) + loop x v mutable'errors + 34 -> do !y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "errors" + v <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + (Data.ProtoLens.Encoding.Growing.append + mutable'errors + y) + loop x mutable'changes v + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + mutable'changes + mutable'errors + in + (do mutable'changes <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + Data.ProtoLens.Encoding.Growing.new + mutable'errors <- Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO + Data.ProtoLens.Encoding.Growing.new + loop Data.ProtoLens.defMessage mutable'changes mutable'errors) + Data.ProtoLens.Encoding.Bytes. "TOCSummaryFile" + buildMessage + = (\ _x -> + (let _v = Lens.Family2.view (Data.ProtoLens.Field.field @"path") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 10) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"language") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 18) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + (Data.ProtoLens.Encoding.Bytes.foldMapBuilder + (\ _v -> + (Data.ProtoLens.Encoding.Bytes.putVarInt 26) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + (Lens.Family2.view (Data.ProtoLens.Field.field @"vec'changes") _x)) + Data.Monoid.<> + (Data.ProtoLens.Encoding.Bytes.foldMapBuilder + (\ _v -> + (Data.ProtoLens.Encoding.Bytes.putVarInt 34) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + (Lens.Family2.view (Data.ProtoLens.Field.field @"vec'errors") _x)) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData TOCSummaryFile where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_TOCSummaryFile'_unknownFields x__) - (Control.DeepSeq.deepseq (_TOCSummaryFile'path x__) - (Control.DeepSeq.deepseq (_TOCSummaryFile'language x__) - (Control.DeepSeq.deepseq (_TOCSummaryFile'changes x__) - (Control.DeepSeq.deepseq (_TOCSummaryFile'errors x__) (()))))) + = (\ x__ -> + Control.DeepSeq.deepseq (_TOCSummaryFile'_unknownFields x__) + (Control.DeepSeq.deepseq (_TOCSummaryFile'path x__) + (Control.DeepSeq.deepseq (_TOCSummaryFile'language x__) + (Control.DeepSeq.deepseq (_TOCSummaryFile'changes x__) + (Control.DeepSeq.deepseq (_TOCSummaryFile'errors x__) (())))))) {- | Fields : * 'Proto.Semantic_Fields.source' @:: Lens' TermEdge Data.Int.Int32@ @@ -2473,20 +5256,20 @@ instance Prelude.Show TermEdge where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' TermEdge "source" (Data.Int.Int32) +instance Data.ProtoLens.Field.HasField TermEdge "source" + (Data.Int.Int32) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _TermEdge'source - (\ x__ y__ -> x__{_TermEdge'source = y__})) - Prelude.id -instance Lens.Labels.HasLens' TermEdge "target" (Data.Int.Int32) + fieldOf _ + = (Lens.Family2.Unchecked.lens _TermEdge'source + (\ x__ y__ -> x__{_TermEdge'source = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField TermEdge "target" + (Data.Int.Int32) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _TermEdge'target - (\ x__ y__ -> x__{_TermEdge'target = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _TermEdge'target + (\ x__ y__ -> x__{_TermEdge'target = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message TermEdge where messageName _ = Data.Text.pack "github.semantic.TermEdge" fieldsByTag @@ -2495,16 +5278,14 @@ instance Data.ProtoLens.Message TermEdge where (Data.ProtoLens.ScalarField Data.ProtoLens.Int32Field :: Data.ProtoLens.FieldTypeDescriptor Data.Int.Int32) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "source"))) + (Data.ProtoLens.Field.field @"source")) :: Data.ProtoLens.FieldDescriptor TermEdge target__field_descriptor = Data.ProtoLens.FieldDescriptor "target" (Data.ProtoLens.ScalarField Data.ProtoLens.Int32Field :: Data.ProtoLens.FieldTypeDescriptor Data.Int.Int32) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "target"))) + (Data.ProtoLens.Field.field @"target")) :: Data.ProtoLens.FieldDescriptor TermEdge in Data.Map.fromList @@ -2517,12 +5298,76 @@ instance Data.ProtoLens.Message TermEdge where = TermEdge{_TermEdge'source = Data.ProtoLens.fieldDefault, _TermEdge'target = Data.ProtoLens.fieldDefault, _TermEdge'_unknownFields = ([])} + parseMessage + = let loop :: + TermEdge -> Data.ProtoLens.Encoding.Bytes.Parser TermEdge + loop x + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + x) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 8 -> do y <- (Prelude.fmap Prelude.fromIntegral + Data.ProtoLens.Encoding.Bytes.getVarInt) + Data.ProtoLens.Encoding.Bytes. "source" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"source") y + x) + 16 -> do y <- (Prelude.fmap Prelude.fromIntegral + Data.ProtoLens.Encoding.Bytes.getVarInt) + Data.ProtoLens.Encoding.Bytes. "target" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"target") + y + x) + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + in + (do loop Data.ProtoLens.defMessage) + Data.ProtoLens.Encoding.Bytes. "TermEdge" + buildMessage + = (\ _x -> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"source") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 8) Data.Monoid.<> + ((Data.ProtoLens.Encoding.Bytes.putVarInt) Prelude.. + Prelude.fromIntegral) + _v) + Data.Monoid.<> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"target") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 16) Data.Monoid.<> + ((Data.ProtoLens.Encoding.Bytes.putVarInt) Prelude.. + Prelude.fromIntegral) + _v) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData TermEdge where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_TermEdge'_unknownFields x__) - (Control.DeepSeq.deepseq (_TermEdge'source x__) - (Control.DeepSeq.deepseq (_TermEdge'target x__) (()))) + = (\ x__ -> + Control.DeepSeq.deepseq (_TermEdge'_unknownFields x__) + (Control.DeepSeq.deepseq (_TermEdge'source x__) + (Control.DeepSeq.deepseq (_TermEdge'target x__) (())))) {- | Fields : * 'Proto.Semantic_Fields.vertexId' @:: Lens' TermVertex Data.Int.Int32@ @@ -2541,35 +5386,33 @@ instance Prelude.Show TermVertex where = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) -instance Lens.Labels.HasLens' TermVertex "vertexId" +instance Data.ProtoLens.Field.HasField TermVertex "vertexId" (Data.Int.Int32) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _TermVertex'vertexId - (\ x__ y__ -> x__{_TermVertex'vertexId = y__})) - Prelude.id -instance Lens.Labels.HasLens' TermVertex "term" (Data.Text.Text) + fieldOf _ + = (Lens.Family2.Unchecked.lens _TermVertex'vertexId + (\ x__ y__ -> x__{_TermVertex'vertexId = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField TermVertex "term" + (Data.Text.Text) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _TermVertex'term - (\ x__ y__ -> x__{_TermVertex'term = y__})) - Prelude.id -instance Lens.Labels.HasLens' TermVertex "span" (Span) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _TermVertex'span - (\ x__ y__ -> x__{_TermVertex'span = y__})) - (Data.ProtoLens.maybeLens Data.ProtoLens.defMessage) -instance Lens.Labels.HasLens' TermVertex "maybe'span" + fieldOf _ + = (Lens.Family2.Unchecked.lens _TermVertex'term + (\ x__ y__ -> x__{_TermVertex'term = y__})) + Prelude.. Prelude.id +instance Data.ProtoLens.Field.HasField TermVertex "span" (Span) + where + fieldOf _ + = (Lens.Family2.Unchecked.lens _TermVertex'span + (\ x__ y__ -> x__{_TermVertex'span = y__})) + Prelude.. Data.ProtoLens.maybeLens Data.ProtoLens.defMessage +instance Data.ProtoLens.Field.HasField TermVertex "maybe'span" (Prelude.Maybe Span) where - lensOf' _ - = (Prelude..) - (Lens.Family2.Unchecked.lens _TermVertex'span - (\ x__ y__ -> x__{_TermVertex'span = y__})) - Prelude.id + fieldOf _ + = (Lens.Family2.Unchecked.lens _TermVertex'span + (\ x__ y__ -> x__{_TermVertex'span = y__})) + Prelude.. Prelude.id instance Data.ProtoLens.Message TermVertex where messageName _ = Data.Text.pack "github.semantic.TermVertex" fieldsByTag @@ -2578,24 +5421,21 @@ instance Data.ProtoLens.Message TermVertex where (Data.ProtoLens.ScalarField Data.ProtoLens.Int32Field :: Data.ProtoLens.FieldTypeDescriptor Data.Int.Int32) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "vertexId"))) + (Data.ProtoLens.Field.field @"vertexId")) :: Data.ProtoLens.FieldDescriptor TermVertex term__field_descriptor = Data.ProtoLens.FieldDescriptor "term" (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "term"))) + (Data.ProtoLens.Field.field @"term")) :: Data.ProtoLens.FieldDescriptor TermVertex span__field_descriptor = Data.ProtoLens.FieldDescriptor "span" (Data.ProtoLens.MessageField Data.ProtoLens.MessageType :: Data.ProtoLens.FieldTypeDescriptor Span) (Data.ProtoLens.OptionalField - (Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'span"))) + (Data.ProtoLens.Field.field @"maybe'span")) :: Data.ProtoLens.FieldDescriptor TermVertex in Data.Map.fromList @@ -2610,10 +5450,104 @@ instance Data.ProtoLens.Message TermVertex where _TermVertex'term = Data.ProtoLens.fieldDefault, _TermVertex'span = Prelude.Nothing, _TermVertex'_unknownFields = ([])} + parseMessage + = let loop :: + TermVertex -> Data.ProtoLens.Encoding.Bytes.Parser TermVertex + loop x + = do end <- Data.ProtoLens.Encoding.Bytes.atEnd + if end then + do let missing = [] in + if Prelude.null missing then Prelude.return () else + Prelude.fail + (("Missing required fields: ") Prelude.++ + Prelude.show (missing :: ([Prelude.String]))) + Prelude.return + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> Prelude.reverse t) + x) + else + do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt + case tag of + 8 -> do y <- (Prelude.fmap Prelude.fromIntegral + Data.ProtoLens.Encoding.Bytes.getVarInt) + Data.ProtoLens.Encoding.Bytes. "vertex_id" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"vertexId") + y + x) + 18 -> do y <- (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.getBytes + (Prelude.fromIntegral len) + Data.ProtoLens.Encoding.Bytes.runEither + (case Data.Text.Encoding.decodeUtf8' value of + Prelude.Left err -> Prelude.Left + (Prelude.show err) + Prelude.Right r -> Prelude.Right r)) + Data.ProtoLens.Encoding.Bytes. "term" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"term") y + x) + 26 -> do y <- (do len <- Data.ProtoLens.Encoding.Bytes.getVarInt + Data.ProtoLens.Encoding.Bytes.isolate + (Prelude.fromIntegral len) + Data.ProtoLens.parseMessage) + Data.ProtoLens.Encoding.Bytes. "span" + loop + (Lens.Family2.set (Data.ProtoLens.Field.field @"span") y + x) + wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire + wire + loop + (Lens.Family2.over Data.ProtoLens.unknownFields + (\ !t -> (:) y t) + x) + in + (do loop Data.ProtoLens.defMessage) + Data.ProtoLens.Encoding.Bytes. "TermVertex" + buildMessage + = (\ _x -> + (let _v + = Lens.Family2.view (Data.ProtoLens.Field.field @"vertexId") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 8) Data.Monoid.<> + ((Data.ProtoLens.Encoding.Bytes.putVarInt) Prelude.. + Prelude.fromIntegral) + _v) + Data.Monoid.<> + (let _v = Lens.Family2.view (Data.ProtoLens.Field.field @"term") _x + in + if (_v) Prelude.== Data.ProtoLens.fieldDefault then + Data.Monoid.mempty else + (Data.ProtoLens.Encoding.Bytes.putVarInt 18) Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral (Data.ByteString.length bs))) + Data.Monoid.<> Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.Text.Encoding.encodeUtf8) + _v) + Data.Monoid.<> + (case + Lens.Family2.view (Data.ProtoLens.Field.field @"maybe'span") _x of + (Prelude.Nothing) -> Data.Monoid.mempty + Prelude.Just _v -> (Data.ProtoLens.Encoding.Bytes.putVarInt 26) + Data.Monoid.<> + (((\ bs -> + (Data.ProtoLens.Encoding.Bytes.putVarInt + (Prelude.fromIntegral + (Data.ByteString.length bs))) + Data.Monoid.<> + Data.ProtoLens.Encoding.Bytes.putBytes bs)) + Prelude.. Data.ProtoLens.encodeMessage) + _v) + Data.Monoid.<> + Data.ProtoLens.Encoding.Wire.buildFieldSet + (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData TermVertex where rnf - = \ x__ -> - Control.DeepSeq.deepseq (_TermVertex'_unknownFields x__) - (Control.DeepSeq.deepseq (_TermVertex'vertexId x__) - (Control.DeepSeq.deepseq (_TermVertex'term x__) - (Control.DeepSeq.deepseq (_TermVertex'span x__) (())))) + = (\ x__ -> + Control.DeepSeq.deepseq (_TermVertex'_unknownFields x__) + (Control.DeepSeq.deepseq (_TermVertex'vertexId x__) + (Control.DeepSeq.deepseq (_TermVertex'term x__) + (Control.DeepSeq.deepseq (_TermVertex'span x__) (()))))) \ No newline at end of file diff --git a/src/Proto/Semantic_Fields.hs b/src/Proto/Semantic_Fields.hs index 04df624afc..bac7dd69c3 100644 --- a/src/Proto/Semantic_Fields.hs +++ b/src/Proto/Semantic_Fields.hs @@ -2,15 +2,32 @@ {-# LANGUAGE ScopedTypeVariables, DataKinds, TypeFamilies, UndecidableInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses, FlexibleContexts, FlexibleInstances, - PatternSynonyms, MagicHash, NoImplicitPrelude, DataKinds #-} + PatternSynonyms, MagicHash, NoImplicitPrelude, DataKinds, + BangPatterns, TypeApplications #-} {-# OPTIONS_GHC -fno-warn-unused-imports#-} +{-# OPTIONS_GHC -Wno-missing-export-lists #-} -- Manually added for semantic's project settings {-# OPTIONS_GHC -fno-warn-duplicate-exports#-} module Proto.Semantic_Fields where import qualified Data.ProtoLens.Runtime.Prelude as Prelude import qualified Data.ProtoLens.Runtime.Data.Int as Data.Int +import qualified Data.ProtoLens.Runtime.Data.Monoid as Data.Monoid import qualified Data.ProtoLens.Runtime.Data.Word as Data.Word import qualified Data.ProtoLens.Runtime.Data.ProtoLens as Data.ProtoLens +import qualified + Data.ProtoLens.Runtime.Data.ProtoLens.Encoding.Bytes + as Data.ProtoLens.Encoding.Bytes +import qualified + Data.ProtoLens.Runtime.Data.ProtoLens.Encoding.Growing + as Data.ProtoLens.Encoding.Growing +import qualified + Data.ProtoLens.Runtime.Data.ProtoLens.Encoding.Parser.Unsafe + as Data.ProtoLens.Encoding.Parser.Unsafe +import qualified + Data.ProtoLens.Runtime.Data.ProtoLens.Encoding.Wire + as Data.ProtoLens.Encoding.Wire +import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Field + as Data.ProtoLens.Field import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Message.Enum as Data.ProtoLens.Message.Enum import qualified @@ -26,398 +43,362 @@ import qualified Data.ProtoLens.Runtime.Data.ByteString as Data.ByteString import qualified Data.ProtoLens.Runtime.Data.ByteString.Char8 as Data.ByteString.Char8 -import qualified Data.ProtoLens.Runtime.Lens.Labels as Lens.Labels +import qualified Data.ProtoLens.Runtime.Data.Text.Encoding + as Data.Text.Encoding +import qualified Data.ProtoLens.Runtime.Data.Vector as Data.Vector +import qualified Data.ProtoLens.Runtime.Data.Vector.Generic + as Data.Vector.Generic +import qualified Data.ProtoLens.Runtime.Data.Vector.Unboxed + as Data.Vector.Unboxed import qualified Data.ProtoLens.Runtime.Text.Read as Text.Read after :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "after" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "after" a) => Lens.Family2.LensLike' f s a -after - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "after") +after = Data.ProtoLens.Field.field @"after" afterSpan :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "afterSpan" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "afterSpan" a) => Lens.Family2.LensLike' f s a -afterSpan - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "afterSpan") +afterSpan = Data.ProtoLens.Field.field @"afterSpan" afterTerm :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "afterTerm" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "afterTerm" a) => Lens.Family2.LensLike' f s a -afterTerm - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "afterTerm") +afterTerm = Data.ProtoLens.Field.field @"afterTerm" before :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "before" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "before" a) => Lens.Family2.LensLike' f s a -before - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "before") +before = Data.ProtoLens.Field.field @"before" beforeSpan :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "beforeSpan" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "beforeSpan" a) => Lens.Family2.LensLike' f s a -beforeSpan - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "beforeSpan") +beforeSpan = Data.ProtoLens.Field.field @"beforeSpan" beforeTerm :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "beforeTerm" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "beforeTerm" a) => Lens.Family2.LensLike' f s a -beforeTerm - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "beforeTerm") +beforeTerm = Data.ProtoLens.Field.field @"beforeTerm" blobOid :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "blobOid" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "blobOid" a) => Lens.Family2.LensLike' f s a -blobOid - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "blobOid") +blobOid = Data.ProtoLens.Field.field @"blobOid" blobs :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "blobs" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "blobs" a) => Lens.Family2.LensLike' f s a -blobs - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "blobs") +blobs = Data.ProtoLens.Field.field @"blobs" category :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "category" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "category" a) => Lens.Family2.LensLike' f s a -category - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "category") +category = Data.ProtoLens.Field.field @"category" changeType :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "changeType" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "changeType" a) => Lens.Family2.LensLike' f s a -changeType - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "changeType") +changeType = Data.ProtoLens.Field.field @"changeType" changes :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "changes" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "changes" a) => Lens.Family2.LensLike' f s a -changes - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "changes") +changes = Data.ProtoLens.Field.field @"changes" column :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "column" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "column" a) => Lens.Family2.LensLike' f s a -column - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "column") +column = Data.ProtoLens.Field.field @"column" content :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "content" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "content" a) => Lens.Family2.LensLike' f s a -content - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "content") +content = Data.ProtoLens.Field.field @"content" deleted :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "deleted" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "deleted" a) => Lens.Family2.LensLike' f s a -deleted - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "deleted") +deleted = Data.ProtoLens.Field.field @"deleted" diffVertexId :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "diffVertexId" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "diffVertexId" a) => Lens.Family2.LensLike' f s a -diffVertexId - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "diffVertexId") +diffVertexId = Data.ProtoLens.Field.field @"diffVertexId" docs :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "docs" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "docs" a) => Lens.Family2.LensLike' f s a -docs - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "docs") +docs = Data.ProtoLens.Field.field @"docs" docstring :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "docstring" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "docstring" a) => Lens.Family2.LensLike' f s a -docstring - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "docstring") +docstring = Data.ProtoLens.Field.field @"docstring" edges :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "edges" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "edges" a) => Lens.Family2.LensLike' f s a -edges - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "edges") +edges = Data.ProtoLens.Field.field @"edges" end :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "end" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "end" a) => Lens.Family2.LensLike' f s a -end - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "end") +end = Data.ProtoLens.Field.field @"end" error :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "error" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "error" a) => Lens.Family2.LensLike' f s a -error - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "error") +error = Data.ProtoLens.Field.field @"error" errors :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "errors" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "errors" a) => Lens.Family2.LensLike' f s a -errors - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "errors") +errors = Data.ProtoLens.Field.field @"errors" files :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "files" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "files" a) => Lens.Family2.LensLike' f s a -files - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "files") +files = Data.ProtoLens.Field.field @"files" hostname :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "hostname" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "hostname" a) => Lens.Family2.LensLike' f s a -hostname - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "hostname") +hostname = Data.ProtoLens.Field.field @"hostname" inserted :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "inserted" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "inserted" a) => Lens.Family2.LensLike' f s a -inserted - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "inserted") +inserted = Data.ProtoLens.Field.field @"inserted" kind :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "kind" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "kind" a) => Lens.Family2.LensLike' f s a -kind - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "kind") +kind = Data.ProtoLens.Field.field @"kind" language :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "language" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "language" a) => Lens.Family2.LensLike' f s a -language - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "language") +language = Data.ProtoLens.Field.field @"language" line :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "line" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "line" a) => Lens.Family2.LensLike' f s a -line - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "line") +line = Data.ProtoLens.Field.field @"line" maybe'after :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'after" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "maybe'after" a) => Lens.Family2.LensLike' f s a -maybe'after - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'after") +maybe'after = Data.ProtoLens.Field.field @"maybe'after" maybe'afterSpan :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'afterSpan" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "maybe'afterSpan" a) => Lens.Family2.LensLike' f s a -maybe'afterSpan - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'afterSpan") +maybe'afterSpan = Data.ProtoLens.Field.field @"maybe'afterSpan" maybe'before :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'before" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "maybe'before" a) => Lens.Family2.LensLike' f s a -maybe'before - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'before") +maybe'before = Data.ProtoLens.Field.field @"maybe'before" maybe'beforeSpan :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'beforeSpan" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "maybe'beforeSpan" a) => Lens.Family2.LensLike' f s a -maybe'beforeSpan - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'beforeSpan") +maybe'beforeSpan = Data.ProtoLens.Field.field @"maybe'beforeSpan" maybe'deleted :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'deleted" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "maybe'deleted" a) => Lens.Family2.LensLike' f s a -maybe'deleted - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'deleted") +maybe'deleted = Data.ProtoLens.Field.field @"maybe'deleted" maybe'diffTerm :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'diffTerm" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "maybe'diffTerm" a) => Lens.Family2.LensLike' f s a -maybe'diffTerm - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'diffTerm") +maybe'diffTerm = Data.ProtoLens.Field.field @"maybe'diffTerm" maybe'docs :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'docs" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "maybe'docs" a) => Lens.Family2.LensLike' f s a -maybe'docs - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'docs") +maybe'docs = Data.ProtoLens.Field.field @"maybe'docs" maybe'end :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'end" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "maybe'end" a) => Lens.Family2.LensLike' f s a -maybe'end - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'end") +maybe'end = Data.ProtoLens.Field.field @"maybe'end" maybe'inserted :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'inserted" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "maybe'inserted" a) => Lens.Family2.LensLike' f s a -maybe'inserted - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'inserted") +maybe'inserted = Data.ProtoLens.Field.field @"maybe'inserted" maybe'merged :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'merged" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "maybe'merged" a) => Lens.Family2.LensLike' f s a -maybe'merged - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'merged") +maybe'merged = Data.ProtoLens.Field.field @"maybe'merged" maybe'replaced :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'replaced" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "maybe'replaced" a) => Lens.Family2.LensLike' f s a -maybe'replaced - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'replaced") +maybe'replaced = Data.ProtoLens.Field.field @"maybe'replaced" maybe'span :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'span" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "maybe'span" a) => Lens.Family2.LensLike' f s a -maybe'span - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'span") +maybe'span = Data.ProtoLens.Field.field @"maybe'span" maybe'start :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "maybe'start" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "maybe'start" a) => Lens.Family2.LensLike' f s a -maybe'start - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'start") +maybe'start = Data.ProtoLens.Field.field @"maybe'start" merged :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "merged" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "merged" a) => Lens.Family2.LensLike' f s a -merged - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "merged") +merged = Data.ProtoLens.Field.field @"merged" path :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "path" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "path" a) => Lens.Family2.LensLike' f s a -path - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "path") +path = Data.ProtoLens.Field.field @"path" replaced :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "replaced" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "replaced" a) => Lens.Family2.LensLike' f s a -replaced - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "replaced") +replaced = Data.ProtoLens.Field.field @"replaced" service :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "service" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "service" a) => Lens.Family2.LensLike' f s a -service - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "service") +service = Data.ProtoLens.Field.field @"service" sha :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "sha" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "sha" a) => Lens.Family2.LensLike' f s a -sha - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "sha") +sha = Data.ProtoLens.Field.field @"sha" source :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "source" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "source" a) => Lens.Family2.LensLike' f s a -source - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "source") +source = Data.ProtoLens.Field.field @"source" span :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "span" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "span" a) => Lens.Family2.LensLike' f s a -span - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "span") +span = Data.ProtoLens.Field.field @"span" start :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "start" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "start" a) => Lens.Family2.LensLike' f s a -start - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "start") +start = Data.ProtoLens.Field.field @"start" status :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "status" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "status" a) => Lens.Family2.LensLike' f s a -status - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "status") +status = Data.ProtoLens.Field.field @"status" symbol :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "symbol" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "symbol" a) => Lens.Family2.LensLike' f s a -symbol - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "symbol") +symbol = Data.ProtoLens.Field.field @"symbol" symbols :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "symbols" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "symbols" a) => Lens.Family2.LensLike' f s a -symbols - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "symbols") +symbols = Data.ProtoLens.Field.field @"symbols" target :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "target" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "target" a) => Lens.Family2.LensLike' f s a -target - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "target") +target = Data.ProtoLens.Field.field @"target" term :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "term" a) => + (Prelude.Functor f, Data.ProtoLens.Field.HasField s "term" a) => Lens.Family2.LensLike' f s a -term - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "term") +term = Data.ProtoLens.Field.field @"term" timestamp :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "timestamp" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "timestamp" a) => + Lens.Family2.LensLike' f s a +timestamp = Data.ProtoLens.Field.field @"timestamp" +vec'blobs :: + forall f s a . + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "vec'blobs" a) => + Lens.Family2.LensLike' f s a +vec'blobs = Data.ProtoLens.Field.field @"vec'blobs" +vec'changes :: + forall f s a . + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "vec'changes" a) => + Lens.Family2.LensLike' f s a +vec'changes = Data.ProtoLens.Field.field @"vec'changes" +vec'edges :: + forall f s a . + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "vec'edges" a) => + Lens.Family2.LensLike' f s a +vec'edges = Data.ProtoLens.Field.field @"vec'edges" +vec'errors :: + forall f s a . + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "vec'errors" a) => + Lens.Family2.LensLike' f s a +vec'errors = Data.ProtoLens.Field.field @"vec'errors" +vec'files :: + forall f s a . + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "vec'files" a) => Lens.Family2.LensLike' f s a -timestamp - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "timestamp") +vec'files = Data.ProtoLens.Field.field @"vec'files" +vec'symbols :: + forall f s a . + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "vec'symbols" a) => + Lens.Family2.LensLike' f s a +vec'symbols = Data.ProtoLens.Field.field @"vec'symbols" +vec'vertices :: + forall f s a . + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "vec'vertices" a) => + Lens.Family2.LensLike' f s a +vec'vertices = Data.ProtoLens.Field.field @"vec'vertices" vertexId :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "vertexId" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "vertexId" a) => Lens.Family2.LensLike' f s a -vertexId - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "vertexId") +vertexId = Data.ProtoLens.Field.field @"vertexId" vertices :: forall f s a . - (Prelude.Functor f, Lens.Labels.HasLens' s "vertices" a) => + (Prelude.Functor f, + Data.ProtoLens.Field.HasField s "vertices" a) => Lens.Family2.LensLike' f s a -vertices - = Lens.Labels.lensOf' - ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "vertices") \ No newline at end of file +vertices = Data.ProtoLens.Field.field @"vertices" diff --git a/src/Rendering/Graph.hs b/src/Rendering/Graph.hs index c5963e8f2f..96d8e82742 100644 --- a/src/Rendering/Graph.hs +++ b/src/Rendering/Graph.hs @@ -57,7 +57,7 @@ diffStyle name = (defaultStyle (fromString . show . view diffVertexId)) vertexAttributes v = case v^.maybe'diffTerm of Just (DiffTreeVertex'Deleted x) -> [ "label" := fromString (T.unpack (x^.term)), "color" := "red" ] Just (DiffTreeVertex'Inserted x) -> [ "label" := fromString (T.unpack (x^.term)), "color" := "green" ] - Just (DiffTreeVertex'Replaced x) -> [ "label" := "Replacement", "color" := "orange", "style" := "dashed" ] + Just (DiffTreeVertex'Replaced _) -> [ "label" := "Replacement", "color" := "orange", "style" := "dashed" ] Just (DiffTreeVertex'Merged x) -> [ "label" := fromString (T.unpack (x^.term)) ] _ -> [] From e3506e83f2df4fc9d3f0e863fbf4d9795bdd60ae Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Mon, 30 Sep 2019 16:32:04 -0700 Subject: [PATCH 04/13] Fix a few tests --- test/Rendering/TOC/Spec.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/Rendering/TOC/Spec.hs b/test/Rendering/TOC/Spec.hs index 1a5ff719a2..7d94a1dada 100644 --- a/test/Rendering/TOC/Spec.hs +++ b/test/Rendering/TOC/Spec.hs @@ -147,22 +147,22 @@ spec = do describe "diff with ToCDiffRenderer'" $ do it "produces JSON output" $ do blobs <- blobsForPaths (Both (Path.relFile "ruby/toc/methods.A.rb") (Path.relFile "ruby/toc/methods.B.rb")) - output <- runTaskOrDie (diffSummaryBuilder Format.JSON [blobs]) + output <- runTaskOrDie (diffSummaryBuilder Format.JSONPB [blobs]) runBuilder output `shouldBe` ("{\"files\":[{\"path\":\"test/fixtures/ruby/toc/methods.A.rb -> test/fixtures/ruby/toc/methods.B.rb\",\"language\":\"Ruby\",\"changes\":[{\"category\":\"Method\",\"term\":\"self.foo\",\"span\":{\"start\":{\"line\":1,\"column\":1},\"end\":{\"line\":2,\"column\":4}},\"changeType\":\"ADDED\"},{\"category\":\"Method\",\"term\":\"bar\",\"span\":{\"start\":{\"line\":4,\"column\":1},\"end\":{\"line\":6,\"column\":4}},\"changeType\":\"MODIFIED\"},{\"category\":\"Method\",\"term\":\"baz\",\"span\":{\"start\":{\"line\":4,\"column\":1},\"end\":{\"line\":5,\"column\":4}},\"changeType\":\"REMOVED\"}]}]}\n" :: ByteString) it "produces JSON output if there are parse errors" $ do blobs <- blobsForPaths (Both (Path.relFile "ruby/toc/methods.A.rb") (Path.relFile "ruby/toc/methods.X.rb")) - output <- runTaskOrDie (diffSummaryBuilder Format.JSON [blobs]) + output <- runTaskOrDie (diffSummaryBuilder Format.JSONPB [blobs]) runBuilder output `shouldBe` ("{\"files\":[{\"path\":\"test/fixtures/ruby/toc/methods.A.rb -> test/fixtures/ruby/toc/methods.X.rb\",\"language\":\"Ruby\",\"changes\":[{\"category\":\"Method\",\"term\":\"bar\",\"span\":{\"start\":{\"line\":1,\"column\":1},\"end\":{\"line\":2,\"column\":4}},\"changeType\":\"REMOVED\"},{\"category\":\"Method\",\"term\":\"baz\",\"span\":{\"start\":{\"line\":4,\"column\":1},\"end\":{\"line\":5,\"column\":4}},\"changeType\":\"REMOVED\"}],\"errors\":[{\"error\":\"expected end of input nodes, but got ParseError\",\"span\":{\"start\":{\"line\":1,\"column\":1},\"end\":{\"line\":2,\"column\":3}}}]}]}\n" :: ByteString) it "ignores anonymous functions" $ do blobs <- blobsForPaths (Both (Path.relFile "ruby/toc/lambda.A.rb") (Path.relFile "ruby/toc/lambda.B.rb")) - output <- runTaskOrDie (diffSummaryBuilder Format.JSON [blobs]) + output <- runTaskOrDie (diffSummaryBuilder Format.JSONPB [blobs]) runBuilder output `shouldBe` ("{\"files\":[{\"path\":\"test/fixtures/ruby/toc/lambda.A.rb -> test/fixtures/ruby/toc/lambda.B.rb\",\"language\":\"Ruby\"}]}\n" :: ByteString) it "summarizes Markdown headings" $ do blobs <- blobsForPaths (Both (Path.relFile "markdown/toc/headings.A.md") (Path.relFile "markdown/toc/headings.B.md")) - output <- runTaskOrDie (diffSummaryBuilder Format.JSON [blobs]) + output <- runTaskOrDie (diffSummaryBuilder Format.JSONPB [blobs]) runBuilder output `shouldBe` ("{\"files\":[{\"path\":\"test/fixtures/markdown/toc/headings.A.md -> test/fixtures/markdown/toc/headings.B.md\",\"language\":\"Markdown\",\"changes\":[{\"category\":\"Heading 1\",\"term\":\"Introduction\",\"span\":{\"start\":{\"line\":1,\"column\":1},\"end\":{\"line\":3,\"column\":16}},\"changeType\":\"REMOVED\"},{\"category\":\"Heading 2\",\"term\":\"Two\",\"span\":{\"start\":{\"line\":5,\"column\":1},\"end\":{\"line\":7,\"column\":4}},\"changeType\":\"MODIFIED\"},{\"category\":\"Heading 3\",\"term\":\"This heading is new\",\"span\":{\"start\":{\"line\":9,\"column\":1},\"end\":{\"line\":11,\"column\":10}},\"changeType\":\"ADDED\"},{\"category\":\"Heading 1\",\"term\":\"Final\",\"span\":{\"start\":{\"line\":13,\"column\":1},\"end\":{\"line\":14,\"column\":4}},\"changeType\":\"ADDED\"}]}]}\n" :: ByteString) From cba98ae288a02714cd25aca2db34032c4d65d4b9 Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Tue, 1 Oct 2019 10:43:37 -0700 Subject: [PATCH 05/13] Try out manually defining json instances --- semantic.cabal | 1 + src/Proto/Semantic_JSON.hs | 43 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 src/Proto/Semantic_JSON.hs diff --git a/semantic.cabal b/semantic.cabal index e39cc0697c..9c2f77e59e 100644 --- a/semantic.cabal +++ b/semantic.cabal @@ -240,6 +240,7 @@ library -- API , Proto.Semantic , Proto.Semantic_Fields + , Proto.Semantic_JSON , Semantic.Api , Semantic.Api.Bridge , Semantic.Api.Diffs diff --git a/src/Proto/Semantic_JSON.hs b/src/Proto/Semantic_JSON.hs new file mode 100644 index 0000000000..e8458ec364 --- /dev/null +++ b/src/Proto/Semantic_JSON.hs @@ -0,0 +1,43 @@ +{-# OPTIONS_GHC -Wno-missing-export-lists #-} +{-# OPTIONS_GHC -Wno-orphans #-} +module Proto.Semantic_JSON where + +import Control.Lens hiding ((.=)) +import Data.Aeson as A +import Data.ProtoLens (defMessage) +import Proto.Semantic as P +import Proto.Semantic_Fields as P + +instance FromJSON PingRequest where + parseJSON = withObject "PingRequest" $ \obj -> do + service <- obj .: "service" + pure $ defMessage & P.service .~ service + +instance ToJSON PingRequest where + toJSON x = object [ "service" .= (x^.service) ] + toEncoding x = pairs $ "service" .= (x^.service) + +instance FromJSON PingResponse where + parseJSON = A.withObject "PingResponse" $ \obj -> do + status <- obj .: "status" + hostname <- obj .: "hostname" + timestamp <- obj .: "timestamp" + sha <- obj .: "sha" + pure $ defMessage + & P.status .~ status + & P.hostname .~ hostname + & P.timestamp .~ timestamp + & P.sha .~ sha + +instance ToJSON PingResponse where + toJSON x = object + [ "status" .= (x^.status) + , "hostname" .= (x^.hostname) + , "timestamp" .= (x^.timestamp) + , "sha" .= (x^.sha) + ] + toEncoding x = pairs $ + "status" .= (x^.status) + <> "hostname" .= (x^.hostname) + <> "timestamp" .= (x^.timestamp) + <> "sha" .= (x^.sha) From fccbe6aa58c0d07b2fdd155c14674fa1a95d436e Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Tue, 1 Oct 2019 14:17:18 -0700 Subject: [PATCH 06/13] Write out custom To/FromJSON instances --- semantic.cabal | 1 - src/Proto/Semantic_JSON.hs | 469 +++++++++- src/Semantic/Api/Diffs.hs | 3 +- src/Semantic/Api/Terms.hs | 3 +- src/Semantic/CLI.hs | 5 +- src/Semantic/Proto/SemanticPB.hs | 1368 ------------------------------ src/Serializing/Format.hs | 5 +- test/Rendering/TOC/Spec.hs | 8 +- test/Semantic/CLI/Spec.hs | 4 +- 9 files changed, 478 insertions(+), 1388 deletions(-) delete mode 100644 src/Semantic/Proto/SemanticPB.hs diff --git a/semantic.cabal b/semantic.cabal index 9c2f77e59e..8a36b55be0 100644 --- a/semantic.cabal +++ b/semantic.cabal @@ -72,7 +72,6 @@ common dependencies , these >= 0.7 && <1 , unix ^>= 2.7.2.2 , proto-lens == 0.5.1.0 - , proto-lens-json == 0.3.0.0 , proto-lens-runtime == 0.5.0.0 , lingo >= 0.2.0.0 diff --git a/src/Proto/Semantic_JSON.hs b/src/Proto/Semantic_JSON.hs index e8458ec364..cce56fe773 100644 --- a/src/Proto/Semantic_JSON.hs +++ b/src/Proto/Semantic_JSON.hs @@ -2,11 +2,17 @@ {-# OPTIONS_GHC -Wno-orphans #-} module Proto.Semantic_JSON where -import Control.Lens hiding ((.=)) -import Data.Aeson as A -import Data.ProtoLens (defMessage) -import Proto.Semantic as P -import Proto.Semantic_Fields as P +import Control.Lens hiding ((.=)) +import Control.Monad (msum) +import Data.Aeson as A +import qualified Data.Aeson.Encoding as E +import Data.Aeson.Types (parseField) +import Data.ProtoLens (defMessage) +import qualified Data.Text as T +import Prelude hiding (error, span) +import Proto.Semantic as P +import Proto.Semantic_Fields as P + instance FromJSON PingRequest where parseJSON = withObject "PingRequest" $ \obj -> do @@ -41,3 +47,456 @@ instance ToJSON PingResponse where <> "hostname" .= (x^.hostname) <> "timestamp" .= (x^.timestamp) <> "sha" .= (x^.sha) + +instance FromJSON ParseTreeRequest where + parseJSON = withObject "ParseTreeRequest" $ \obj -> do + blobs <- obj .: "blobs" + pure $ defMessage & P.blobs .~ blobs + +instance ToJSON ParseTreeRequest where + toJSON x = object [ "blobs" .= (x^.blobs) ] + toEncoding x = pairs $ "blobs" .= (x^.blobs) + +instance FromJSON Blob where + parseJSON = withObject "Blob" $ \obj -> do + content <- obj .: "content" + path <- obj .: "path" + language <- obj .: "language" + pure $ defMessage + & P.content .~ content + & P.path .~ path + & P.language .~ language + +instance ToJSON Blob where + toJSON x = object + [ "content" .= (x^.content) + , "path" .= (x^.path) + , "language" .= (x^.language) + ] + toEncoding x = pairs $ + "content" .= (x^.content) + <> "path" .= (x^.path) + <> "language" .= (x^.language) + +instance FromJSON ParseTreeSymbolResponse where + parseJSON = withObject "ParseTreeSymbolResponse" $ \obj -> do + files <- obj .: "files" + pure $ defMessage & P.files .~ files + +instance ToJSON ParseTreeSymbolResponse where + toJSON x = object [ "files" .= (x^.files) ] + toEncoding x = pairs $ "files" .= (x^.files) + +instance FromJSON ParseTreeGraphResponse where + parseJSON = withObject "ParseTreeGraphResponse" $ \obj -> do + files <- obj .: "files" + pure $ defMessage & P.files .~ files + +instance ToJSON ParseTreeGraphResponse where + toJSON x = object [ "files" .= (x^.files) ] + toEncoding x = pairs $ "files" .= (x^.files) + +instance FromJSON ParseTreeFileGraph where + parseJSON = withObject "ParseTreeFileGraph" $ \obj -> do + path <- obj .: "path" + language <- obj .: "language" + vertices <- obj .: "vertices" + edges <- obj .: "edges" + errors <- obj .: "errors" + pure $ defMessage + & P.path .~ path + & P.language .~ language + & P.vertices .~ vertices + & P.edges .~ edges + & P.errors .~ errors + +instance ToJSON ParseTreeFileGraph where + toJSON x = object + [ "path" .= (x^.path) + , "language" .= (x^.language) + , "vertices" .= (x^.vertices) + , "edges" .= (x^.edges) + , "errors" .= (x^.errors) + ] + toEncoding x = pairs $ + "path" .= (x^.path) + <> "language" .= (x^.language) + <> "vertices" .= (x^.vertices) + <> "edges" .= (x^.edges) + <> "errors" .= (x^.errors) + +instance FromJSON TermEdge where + parseJSON = withObject "TermEdge" $ \obj -> do + source <- obj .: "source" + target <- obj .: "target" + pure $ defMessage & P.source .~ source & P.target .~ target + +instance ToJSON TermEdge where + toJSON x = object [ "source" .= (x^.source), "target" .= (x^.target) ] + toEncoding x = pairs $ "source" .= (x^.source) <> "target" .= (x^.target) + +instance FromJSON TermVertex where + parseJSON = withObject "TermVertex" $ \obj -> do + vertexId <- obj .: "vertexId" + term <- obj .: "term" + span <- obj .: "span" + pure $ defMessage + & P.vertexId .~ vertexId + & P.term .~ term + & P.span .~ span + +instance ToJSON TermVertex where + toJSON x = object + [ "vertexId" .= (x^.vertexId) + , "term" .= (x^.term) + , "span" .= (x^.span) + ] + toEncoding x = pairs $ + "vertexId" .= (x^.vertexId) + <> "term" .= (x^.term) + <> "span" .= (x^.span) + +instance FromJSON File where + parseJSON = withObject "File" $ \obj -> do + path <- obj .: "path" + language <- obj .: "language" + symbols <- obj .: "symbols" + errors <- obj .: "errors" + blobOid <- obj .: "blobOid" + pure $ defMessage + & P.path .~ path + & P.language .~ language + & P.symbols .~ symbols + & P.errors .~ errors + & P.blobOid .~ blobOid + +instance ToJSON File where + toJSON x = object + [ "path" .= (x^.path) + , "language" .= (x^.language) + , "symbols" .= (x^.symbols) + , "errors" .= (x^.errors) + , "blobOid" .= (x^.blobOid) + ] + toEncoding x = pairs $ + "path" .= (x^.path) + <> "language" .= (x^.language) + <> "symbols" .= (x^.symbols) + <> "errors" .= (x^.errors) + <> "blobOid" .= (x^.blobOid) + +instance FromJSON Symbol where + parseJSON = withObject "Symbol" $ \obj -> do + symbol <- obj .: "symbol" + kind <- obj .: "kind" + line <- obj .: "line" + span <- obj .: "span" + docs <- obj .: "docs" + pure $ defMessage + & P.symbol .~ symbol + & P.kind .~ kind + & P.line .~ line + & P.span .~ span + & P.docs .~ docs + +instance ToJSON Symbol where + toJSON x = object + [ "symbol" .= (x^.symbol) + , "kind" .= (x^.kind) + , "line" .= (x^.line) + , "span" .= (x^.span) + , "docs" .= (x^.docs) + ] + toEncoding x = pairs $ + "symbol" .= (x^.symbol) + <> "kind" .= (x^.kind) + <> "line" .= (x^.line) + <> "span" .= (x^.span) + <> "docs" .= (x^.docs) + +instance FromJSON Span where + parseJSON = withObject "Span" $ \obj -> do + start <- obj .: "start" + end <- obj .: "end" + pure $ defMessage & P.start .~ start & P.end .~ end + +instance ToJSON Span where + toJSON x = object [ "start" .= (x^.start) , "end" .= (x^.end) ] + toEncoding x = pairs $ "start" .= (x^.start) <> "end" .= (x^.end) + +instance FromJSON Position where + parseJSON = withObject "Position" $ \obj -> do + line <- obj .: "line" + column <- obj .: "column" + pure $ defMessage & P.line .~ line & P.column .~ column + +instance ToJSON Position where + toJSON x = object [ "line" .= (x^.line) , "column" .= (x^.column) ] + toEncoding x = pairs $ "line" .= (x^.line) <> "column" .= (x^.column) + +instance FromJSON Docstring where + parseJSON = withObject "Docstring" $ \obj -> do + docstring <- obj .: "docstring" + pure $ defMessage & P.docstring .~ docstring + +instance ToJSON Docstring where + toJSON x = object [ "docstring" .= (x^.docstring) ] + toEncoding x = pairs $ "docstring" .= (x^.docstring) + +instance FromJSON ParseError where + parseJSON = withObject "ParseError" $ \obj -> do + error <- obj .: "error" + pure $ defMessage & P.error .~ error + +instance ToJSON ParseError where + toJSON x = object [ "error" .= (x^.error) ] + toEncoding x = pairs $ "error" .= (x^.error) + +instance FromJSON DiffTreeRequest where + parseJSON = withObject "DiffTreeRequest" $ \obj -> do + blobs <- obj .: "blobs" + pure $ defMessage & P.blobs .~ blobs + +instance ToJSON DiffTreeRequest where + toJSON x = object [ "blobs" .= (x^.blobs) ] + toEncoding x = pairs $ "blobs" .= (x^.blobs) + +instance FromJSON BlobPair where + parseJSON = withObject "BlobPair" $ \obj -> do + before <- obj .: "before" + after <- obj .: "after" + pure $ defMessage & P.before .~ before & P.after .~ after + +instance ToJSON BlobPair where + toJSON x = object [ "before" .= (x^.before), "after" .= (x^.after) ] + toEncoding x = pairs $ "before" .= (x^.before) <> "after" .= (x^.after) + +instance FromJSON DiffTreeTOCResponse where + parseJSON = withObject "DiffTreeTOCResponse" $ \obj -> do + files <- obj .: "files" + pure $ defMessage & P.files .~ files + +instance ToJSON DiffTreeTOCResponse where + toJSON x = object [ "files" .= (x^.files) ] + toEncoding x = pairs $ "files" .= (x^.files) + +instance FromJSON TOCSummaryFile where + parseJSON = withObject "TOCSummaryFile" $ \obj -> do + path <- obj .: "path" + language <- obj .: "language" + changes <- obj .: "changes" + errors <- obj .: "errors" + pure $ defMessage + & P.path .~ path + & P.language .~ language + & P.changes .~ changes + & P.errors .~ errors + +instance ToJSON TOCSummaryFile where + toJSON x = object + [ "path" .= (x^.path) + , "language" .= (x^.language) + , "changes" .= (x^.changes) + , "errors" .= (x^.errors) + ] + toEncoding x = pairs $ + "path" .= (x^.path) + <> "language" .= (x^.language) + <> "changes" .= (x^.changes) + <> "errors" .= (x^.errors) + +instance FromJSON TOCSummaryChange where + parseJSON = withObject "TOCSummaryChange" $ \obj -> do + category <- obj .: "category" + term <- obj .: "term" + span <- obj .: "span" + changeType <- obj .: "changeType" + pure $ defMessage + & P.category .~ category + & P.term .~ term + & P.span .~ span + & P.changeType .~ changeType + +instance ToJSON TOCSummaryChange where + toJSON x = object + [ "category" .= (x^.category) + , "term" .= (x^.term) + , "span" .= (x^.span) + , "changeType" .= (x^.changeType) + ] + toEncoding x = pairs $ + "category" .= (x^.category) + <> "term" .= (x^.term) + <> "span" .= (x^.span) + <> "changeType" .= (x^.changeType) + +instance FromJSON TOCSummaryError where + parseJSON = withObject "TOCSummaryError" $ \obj -> do + error <- obj .: "error" + span <- obj .: "span" + pure $ defMessage & P.error .~ error & P.span .~ span + +instance ToJSON TOCSummaryError where + toJSON x = object [ "error" .= (x^.error), "span" .= (x^.span) ] + toEncoding x = pairs $ "error" .= (x^.error) <> "span" .= (x^.span) + +instance FromJSON ChangeType where + parseJSON (A.String "NONE") = pure NONE + parseJSON (A.String "ADDED") = pure ADDED + parseJSON (A.String "REMOVED") = pure REMOVED + parseJSON (A.String "MODIFIED") = pure MODIFIED + parseJSON _ = fail "unexpected ChangeType" + +instance ToJSON ChangeType where + toJSON x = A.String . T.toUpper . T.pack $ show x + toEncoding x = E.text . T.toUpper . T.pack $ show x + +instance FromJSON DiffTreeGraphResponse where + parseJSON = withObject "DiffTreeGraphResponse" $ \obj -> do + files <- obj .: "files" + pure $ defMessage & P.files .~ files + +instance ToJSON DiffTreeGraphResponse where + toJSON x = object [ "files" .= (x^.files) ] + toEncoding x = pairs $ "files" .= (x^.files) + +instance FromJSON DiffTreeFileGraph where + parseJSON = withObject "DiffTreeFileGraph" $ \obj -> do + path <- obj .: "path" + language <- obj .: "language" + vertices <- obj .: "vertices" + edges <- obj .: "edges" + errors <- obj .: "errors" + pure $ defMessage + & P.path .~ path + & P.language .~ language + & P.vertices .~ vertices + & P.edges .~ edges + & P.errors .~ errors + +instance ToJSON DiffTreeFileGraph where + toJSON x = object + [ "path" .= (x^.path) + , "language" .= (x^.language) + , "vertices" .= (x^.vertices) + , "edges" .= (x^.edges) + , "errors" .= (x^.errors) + ] + toEncoding x = pairs $ + "path" .= (x^.path) + <> "language" .= (x^.language) + <> "vertices" .= (x^.vertices) + <> "edges" .= (x^.edges) + <> "errors" .= (x^.errors) + +instance FromJSON DiffTreeEdge where + parseJSON = withObject "DiffTreeEdge" $ \obj -> do + source <- obj .: "source" + target <- obj .: "target" + pure $ defMessage & P.source .~ source & P.target .~ target + +instance ToJSON DiffTreeEdge where + toJSON x = object [ "source" .= (x^.source), "target" .= (x^.target) ] + toEncoding x = pairs $ "source" .= (x^.source) <> "target" .= (x^.target) + +instance FromJSON DiffTreeVertex where + parseJSON = withObject "DiffTreeVertex" $ \obj -> do + diffVertexId <- obj .: "diffVertexId" + diffTerm <- obj .: "diffTerm" + pure $ defMessage + & P.diffVertexId .~ diffVertexId + & P.maybe'diffTerm .~ diffTerm + +instance ToJSON DiffTreeVertex where + toJSON x = object + [ "diffVertexId" .= (x^.diffVertexId) + , "diffTerm" .= (x^.maybe'diffTerm) + ] + toEncoding x = pairs $ + "diffVertexId" .= (x^.diffVertexId) + <> "diffTerm" .= (x^.maybe'diffTerm) + +instance FromJSON DiffTreeVertex'DiffTerm where + parseJSON = withObject "DiffTreeVertexDiffTerm" $ \obj -> msum + [ + DiffTreeVertex'Deleted <$> parseField obj "deleted" + , DiffTreeVertex'Inserted <$> parseField obj "inserted" + , DiffTreeVertex'Replaced <$> parseField obj "replaced" + , DiffTreeVertex'Merged <$> parseField obj "merged" + ] + +instance ToJSON DiffTreeVertex'DiffTerm where + toJSON (DiffTreeVertex'Deleted x) = object [ "deleted" .= x ] + toJSON (DiffTreeVertex'Inserted x) = object [ "inserted" .= x ] + toJSON (DiffTreeVertex'Replaced x) = object [ "replaced" .= x ] + toJSON (DiffTreeVertex'Merged x) = object [ "merged" .= x ] + toEncoding (DiffTreeVertex'Deleted x) = pairs $ "deleted" .= x + toEncoding (DiffTreeVertex'Inserted x) = pairs $ "inserted" .= x + toEncoding (DiffTreeVertex'Replaced x) = pairs $ "replaced" .= x + toEncoding (DiffTreeVertex'Merged x) = pairs $ "merged" .= x + +instance FromJSON MergedTerm where + parseJSON = withObject "MergedTerm" $ \obj -> do + term <- obj .: "term" + beforeSpan <- obj .: "beforeSpan" + afterSpan <- obj .: "afterSpan" + pure $ defMessage + & P.term .~ term + & P.beforeSpan .~ beforeSpan + & P.afterSpan .~ afterSpan + +instance ToJSON MergedTerm where + toJSON x = object + [ "term" .= (x^.term) + , "beforeSpan" .= (x^.beforeSpan) + , "afterSpan" .= (x^.afterSpan) + ] + toEncoding x = pairs $ + "term" .= (x^.term) + <> "beforeSpan" .= (x^.beforeSpan) + <> "afterSpan" .= (x^.afterSpan) + +instance FromJSON ReplacedTerm where + parseJSON = withObject "ReplacedTerm" $ \obj -> do + beforeTerm <- obj .: "beforeTerm" + beforeSpan <- obj .: "beforeSpan" + afterTerm <- obj .: "afterTerm" + afterSpan <- obj .: "afterSpan" + pure $ defMessage + & P.beforeTerm .~ beforeTerm + & P.beforeSpan .~ beforeSpan + & P.afterTerm .~ afterTerm + & P.afterSpan .~ afterSpan + +instance ToJSON ReplacedTerm where + toJSON x = object + [ "beforeTerm" .= (x^.beforeTerm) + , "beforeSpan" .= (x^.beforeSpan) + , "afterTerm" .= (x^.afterTerm) + , "afterSpan" .= (x^.afterSpan) + ] + toEncoding x = pairs $ + "beforeTerm" .= (x^.beforeTerm) + <> "beforeSpan" .= (x^.beforeSpan) + <> "afterTerm" .= (x^.afterTerm) + <> "afterSpan" .= (x^.afterSpan) + +instance FromJSON InsertedTerm where + parseJSON = withObject "InsertedTerm" $ \obj -> do + term <- obj .: "term" + span <- obj .: "span" + pure $ defMessage & P.term .~ term & P.span .~ span + +instance ToJSON InsertedTerm where + toJSON x = object [ "term" .= (x^.term), "span" .= (x^.span) ] + toEncoding x = pairs $ "term" .= (x^.term) <> "span" .= (x^.span) + +instance FromJSON DeletedTerm where + parseJSON = withObject "DeletedTerm" $ \obj -> do + term <- obj .: "term" + span <- obj .: "span" + pure $ defMessage & P.term .~ term & P.span .~ span + +instance ToJSON DeletedTerm where + toJSON x = object [ "term" .= (x^.term), "span" .= (x^.span) ] + toEncoding x = pairs $ "term" .= (x^.term) <> "span" .= (x^.span) diff --git a/src/Semantic/Api/Diffs.hs b/src/Semantic/Api/Diffs.hs index e34018643b..18957a4257 100644 --- a/src/Semantic/Api/Diffs.hs +++ b/src/Semantic/Api/Diffs.hs @@ -31,6 +31,7 @@ import Parsing.Parser import Prologue import Proto.Semantic as P hiding (Blob, BlobPair) import Proto.Semantic_Fields as P +import Proto.Semantic_JSON() import Rendering.Graph import Rendering.JSON hiding (JSON) import qualified Rendering.JSON @@ -52,7 +53,7 @@ data DiffOutputFormat parseDiffBuilder :: (Traversable t, DiffEffects sig m) => DiffOutputFormat -> t BlobPair -> m Builder parseDiffBuilder DiffJSONTree = distributeFoldMap (jsonDiff renderJSONTree) >=> serialize Format.JSON -- NB: Serialize happens at the top level for these two JSON formats to collect results of multiple blob pairs. -parseDiffBuilder DiffJSONGraph = diffGraph >=> serialize Format.JSONPB +parseDiffBuilder DiffJSONGraph = diffGraph >=> serialize Format.JSON parseDiffBuilder DiffSExpression = distributeFoldMap sexpDiff parseDiffBuilder DiffShow = distributeFoldMap showDiff parseDiffBuilder DiffDotGraph = distributeFoldMap dotGraphDiff diff --git a/src/Semantic/Api/Terms.hs b/src/Semantic/Api/Terms.hs index 12a9c2ac44..b76ac22ff7 100644 --- a/src/Semantic/Api/Terms.hs +++ b/src/Semantic/Api/Terms.hs @@ -35,6 +35,7 @@ import Parsing.Parser import Prologue import Proto.Semantic as P hiding (Blob) import Proto.Semantic_Fields as P +import Proto.Semantic_JSON() import Rendering.Graph import Rendering.JSON hiding (JSON) import qualified Rendering.JSON @@ -87,7 +88,7 @@ data TermOutputFormat parseTermBuilder :: (Traversable t, Member Distribute sig, ParseEffects sig m, MonadIO m) => TermOutputFormat -> t Blob -> m Builder parseTermBuilder TermJSONTree = distributeFoldMap jsonTerm >=> serialize Format.JSON -- NB: Serialize happens at the top level for these two JSON formats to collect results of multiple blobs. -parseTermBuilder TermJSONGraph = termGraph >=> serialize Format.JSONPB +parseTermBuilder TermJSONGraph = termGraph >=> serialize Format.JSON parseTermBuilder TermSExpression = distributeFoldMap sexpTerm parseTermBuilder TermDotGraph = distributeFoldMap dotGraphTerm parseTermBuilder TermShow = distributeFoldMap showTerm diff --git a/src/Semantic/CLI.hs b/src/Semantic/CLI.hs index 7d761e04e4..efa8f65fca 100644 --- a/src/Semantic/CLI.hs +++ b/src/Semantic/CLI.hs @@ -32,6 +32,7 @@ import Control.Exception (Exception(..), throwTo) import Data.Typeable (Typeable) import System.Posix.Signals import System.Mem.Weak (deRefWeak) +import Proto.Semantic_JSON() newtype SignalException = SignalException Signal deriving (Show, Typeable) @@ -92,7 +93,7 @@ diffCommand = command "diff" (info diffArgumentsParser (progDesc "Compute change renderer <- flag (parseDiffBuilder DiffSExpression) (parseDiffBuilder DiffSExpression) (long "sexpression" <> help "Output s-expression diff tree (default)") <|> flag' (parseDiffBuilder DiffJSONTree) (long "json" <> help "Output JSON diff trees") <|> flag' (parseDiffBuilder DiffJSONGraph) (long "json-graph" <> help "Output JSON diff trees") - <|> flag' (diffSummaryBuilder JSONPB) (long "toc" <> help "Output JSON table of contents diff summary") + <|> flag' (diffSummaryBuilder JSON) (long "toc" <> help "Output JSON table of contents diff summary") <|> flag' (parseDiffBuilder DiffDotGraph) (long "dot" <> help "Output the diff as a DOT graph") <|> flag' (parseDiffBuilder DiffShow) (long "show" <> help "Output using the Show instance (debug only, format subject to change without notice)") filesOrStdin <- Right <$> some (Both <$> argument filePathReader (metavar "FILE_A") <*> argument filePathReader (metavar "FILE_B")) <|> pure (Left stdin) @@ -119,7 +120,7 @@ parseCommand = command "parse" (info parseArgumentsParser (progDesc "Generate pa <|> flag' (parseTermBuilder TermJSONGraph) ( long "json-graph" <> help "Output JSON adjacency list") - <|> flag' (parseSymbolsBuilder JSONPB) + <|> flag' (parseSymbolsBuilder JSON) ( long "symbols" <> long "json-symbols" <> help "Output JSON symbol list") diff --git a/src/Semantic/Proto/SemanticPB.hs b/src/Semantic/Proto/SemanticPB.hs deleted file mode 100644 index 0a5106eddd..0000000000 --- a/src/Semantic/Proto/SemanticPB.hs +++ /dev/null @@ -1,1368 +0,0 @@ --- Code generated by protoc-gen-haskell 0.1.0, DO NOT EDIT. -{-# LANGUAGE DerivingVia, DeriveAnyClass, DuplicateRecordFields #-} -{-# OPTIONS_GHC -Wno-unused-imports -Wno-missing-export-lists #-} -module Semantic.Proto.SemanticPB where - -import Control.DeepSeq -import Control.Monad (msum) -import qualified Data.Aeson as A -import qualified Data.Aeson.Encoding as E -import Data.ByteString (ByteString) -import Data.Int -import Data.Text (Text) -import qualified Data.Text as T -import Data.Vector (Vector) -import Data.Word -import GHC.Generics -import Proto3.Suite (decodeMessageField, encodeMessageField, nestedvec, packedvec) -import qualified Proto3.Suite as Proto3 -import Proto3.Suite.JSONPB as JSONPB -import Proto3.Wire (at, oneof) - -data PingRequest = PingRequest - { service :: Text - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB PingRequest where - parseJSONPB = A.withObject "PingRequest" $ \obj -> PingRequest - <$> obj .: "service" - -instance ToJSONPB PingRequest where - toJSONPB PingRequest{..} = object - [ - "service" .= service - ] - toEncodingPB PingRequest{..} = pairs - [ - "service" .= service - ] - -instance FromJSON PingRequest where - parseJSON = parseJSONPB - -instance ToJSON PingRequest where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message PingRequest where - encodeMessage _ PingRequest{..} = mconcat - [ - encodeMessageField 1 service - ] - decodeMessage _ = PingRequest - <$> at decodeMessageField 1 - dotProto = undefined - -data PingResponse = PingResponse - { status :: Text - , hostname :: Text - , timestamp :: Text - , sha :: Text - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB PingResponse where - parseJSONPB = A.withObject "PingResponse" $ \obj -> PingResponse - <$> obj .: "status" - <*> obj .: "hostname" - <*> obj .: "timestamp" - <*> obj .: "sha" - -instance ToJSONPB PingResponse where - toJSONPB PingResponse{..} = object - [ - "status" .= status - , "hostname" .= hostname - , "timestamp" .= timestamp - , "sha" .= sha - ] - toEncodingPB PingResponse{..} = pairs - [ - "status" .= status - , "hostname" .= hostname - , "timestamp" .= timestamp - , "sha" .= sha - ] - -instance FromJSON PingResponse where - parseJSON = parseJSONPB - -instance ToJSON PingResponse where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message PingResponse where - encodeMessage _ PingResponse{..} = mconcat - [ - encodeMessageField 1 status - , encodeMessageField 2 hostname - , encodeMessageField 3 timestamp - , encodeMessageField 4 sha - ] - decodeMessage _ = PingResponse - <$> at decodeMessageField 1 - <*> at decodeMessageField 2 - <*> at decodeMessageField 3 - <*> at decodeMessageField 4 - dotProto = undefined - -data ParseTreeRequest = ParseTreeRequest - { blobs :: Vector Blob - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB ParseTreeRequest where - parseJSONPB = A.withObject "ParseTreeRequest" $ \obj -> ParseTreeRequest - <$> obj .: "blobs" - -instance ToJSONPB ParseTreeRequest where - toJSONPB ParseTreeRequest{..} = object - [ - "blobs" .= blobs - ] - toEncodingPB ParseTreeRequest{..} = pairs - [ - "blobs" .= blobs - ] - -instance FromJSON ParseTreeRequest where - parseJSON = parseJSONPB - -instance ToJSON ParseTreeRequest where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message ParseTreeRequest where - encodeMessage _ ParseTreeRequest{..} = mconcat - [ - encodeMessageField 1 (Proto3.NestedVec blobs) - ] - decodeMessage _ = ParseTreeRequest - <$> (nestedvec <$> at decodeMessageField 1) - dotProto = undefined - -data ParseTreeSymbolResponse = ParseTreeSymbolResponse - { files :: Vector File - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB ParseTreeSymbolResponse where - parseJSONPB = A.withObject "ParseTreeSymbolResponse" $ \obj -> ParseTreeSymbolResponse - <$> obj .: "files" - -instance ToJSONPB ParseTreeSymbolResponse where - toJSONPB ParseTreeSymbolResponse{..} = object - [ - "files" .= files - ] - toEncodingPB ParseTreeSymbolResponse{..} = pairs - [ - "files" .= files - ] - -instance FromJSON ParseTreeSymbolResponse where - parseJSON = parseJSONPB - -instance ToJSON ParseTreeSymbolResponse where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message ParseTreeSymbolResponse where - encodeMessage _ ParseTreeSymbolResponse{..} = mconcat - [ - encodeMessageField 1 (Proto3.NestedVec files) - ] - decodeMessage _ = ParseTreeSymbolResponse - <$> (nestedvec <$> at decodeMessageField 1) - dotProto = undefined - -data ParseTreeGraphResponse = ParseTreeGraphResponse - { files :: Vector ParseTreeFileGraph - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB ParseTreeGraphResponse where - parseJSONPB = A.withObject "ParseTreeGraphResponse" $ \obj -> ParseTreeGraphResponse - <$> obj .: "files" - -instance ToJSONPB ParseTreeGraphResponse where - toJSONPB ParseTreeGraphResponse{..} = object - [ - "files" .= files - ] - toEncodingPB ParseTreeGraphResponse{..} = pairs - [ - "files" .= files - ] - -instance FromJSON ParseTreeGraphResponse where - parseJSON = parseJSONPB - -instance ToJSON ParseTreeGraphResponse where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message ParseTreeGraphResponse where - encodeMessage _ ParseTreeGraphResponse{..} = mconcat - [ - encodeMessageField 1 (Proto3.NestedVec files) - ] - decodeMessage _ = ParseTreeGraphResponse - <$> (nestedvec <$> at decodeMessageField 1) - dotProto = undefined - -data ParseTreeFileGraph = ParseTreeFileGraph - { path :: Text - , language :: Text - , vertices :: Vector TermVertex - , edges :: Vector TermEdge - , errors :: Vector ParseError - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB ParseTreeFileGraph where - parseJSONPB = A.withObject "ParseTreeFileGraph" $ \obj -> ParseTreeFileGraph - <$> obj .: "path" - <*> obj .: "language" - <*> obj .: "vertices" - <*> obj .: "edges" - <*> obj .: "errors" - -instance ToJSONPB ParseTreeFileGraph where - toJSONPB ParseTreeFileGraph{..} = object - [ - "path" .= path - , "language" .= language - , "vertices" .= vertices - , "edges" .= edges - , "errors" .= errors - ] - toEncodingPB ParseTreeFileGraph{..} = pairs - [ - "path" .= path - , "language" .= language - , "vertices" .= vertices - , "edges" .= edges - , "errors" .= errors - ] - -instance FromJSON ParseTreeFileGraph where - parseJSON = parseJSONPB - -instance ToJSON ParseTreeFileGraph where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message ParseTreeFileGraph where - encodeMessage _ ParseTreeFileGraph{..} = mconcat - [ - encodeMessageField 1 path - , encodeMessageField 2 language - , encodeMessageField 3 (Proto3.NestedVec vertices) - , encodeMessageField 4 (Proto3.NestedVec edges) - , encodeMessageField 5 (Proto3.NestedVec errors) - ] - decodeMessage _ = ParseTreeFileGraph - <$> at decodeMessageField 1 - <*> at decodeMessageField 2 - <*> (nestedvec <$> at decodeMessageField 3) - <*> (nestedvec <$> at decodeMessageField 4) - <*> (nestedvec <$> at decodeMessageField 5) - dotProto = undefined - -data TermEdge = TermEdge - { source :: Int32 - , target :: Int32 - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB TermEdge where - parseJSONPB = A.withObject "TermEdge" $ \obj -> TermEdge - <$> obj .: "source" - <*> obj .: "target" - -instance ToJSONPB TermEdge where - toJSONPB TermEdge{..} = object - [ - "source" .= source - , "target" .= target - ] - toEncodingPB TermEdge{..} = pairs - [ - "source" .= source - , "target" .= target - ] - -instance FromJSON TermEdge where - parseJSON = parseJSONPB - -instance ToJSON TermEdge where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message TermEdge where - encodeMessage _ TermEdge{..} = mconcat - [ - encodeMessageField 1 source - , encodeMessageField 2 target - ] - decodeMessage _ = TermEdge - <$> at decodeMessageField 1 - <*> at decodeMessageField 2 - dotProto = undefined - -data TermVertex = TermVertex - { vertexId :: Int32 - , term :: Text - , span :: Maybe Span - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB TermVertex where - parseJSONPB = A.withObject "TermVertex" $ \obj -> TermVertex - <$> obj .: "vertexId" - <*> obj .: "term" - <*> obj .: "span" - -instance ToJSONPB TermVertex where - toJSONPB TermVertex{..} = object - [ - "vertexId" .= vertexId - , "term" .= term - , "span" .= span - ] - toEncodingPB TermVertex{..} = pairs - [ - "vertexId" .= vertexId - , "term" .= term - , "span" .= span - ] - -instance FromJSON TermVertex where - parseJSON = parseJSONPB - -instance ToJSON TermVertex where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message TermVertex where - encodeMessage _ TermVertex{..} = mconcat - [ - encodeMessageField 1 vertexId - , encodeMessageField 2 term - , encodeMessageField 3 (Proto3.Nested span) - ] - decodeMessage _ = TermVertex - <$> at decodeMessageField 1 - <*> at decodeMessageField 2 - <*> at decodeMessageField 3 - dotProto = undefined - -data ParseError = ParseError - { error :: Text - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB ParseError where - parseJSONPB = A.withObject "ParseError" $ \obj -> ParseError - <$> obj .: "error" - -instance ToJSONPB ParseError where - toJSONPB ParseError{..} = object - [ - "error" .= error - ] - toEncodingPB ParseError{..} = pairs - [ - "error" .= error - ] - -instance FromJSON ParseError where - parseJSON = parseJSONPB - -instance ToJSON ParseError where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message ParseError where - encodeMessage _ ParseError{..} = mconcat - [ - encodeMessageField 1 error - ] - decodeMessage _ = ParseError - <$> at decodeMessageField 1 - dotProto = undefined - -data DiffTreeRequest = DiffTreeRequest - { blobs :: Vector BlobPair - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB DiffTreeRequest where - parseJSONPB = A.withObject "DiffTreeRequest" $ \obj -> DiffTreeRequest - <$> obj .: "blobs" - -instance ToJSONPB DiffTreeRequest where - toJSONPB DiffTreeRequest{..} = object - [ - "blobs" .= blobs - ] - toEncodingPB DiffTreeRequest{..} = pairs - [ - "blobs" .= blobs - ] - -instance FromJSON DiffTreeRequest where - parseJSON = parseJSONPB - -instance ToJSON DiffTreeRequest where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message DiffTreeRequest where - encodeMessage _ DiffTreeRequest{..} = mconcat - [ - encodeMessageField 1 (Proto3.NestedVec blobs) - ] - decodeMessage _ = DiffTreeRequest - <$> (nestedvec <$> at decodeMessageField 1) - dotProto = undefined - -data DiffTreeTOCResponse = DiffTreeTOCResponse - { files :: Vector TOCSummaryFile - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB DiffTreeTOCResponse where - parseJSONPB = A.withObject "DiffTreeTOCResponse" $ \obj -> DiffTreeTOCResponse - <$> obj .: "files" - -instance ToJSONPB DiffTreeTOCResponse where - toJSONPB DiffTreeTOCResponse{..} = object - [ - "files" .= files - ] - toEncodingPB DiffTreeTOCResponse{..} = pairs - [ - "files" .= files - ] - -instance FromJSON DiffTreeTOCResponse where - parseJSON = parseJSONPB - -instance ToJSON DiffTreeTOCResponse where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message DiffTreeTOCResponse where - encodeMessage _ DiffTreeTOCResponse{..} = mconcat - [ - encodeMessageField 1 (Proto3.NestedVec files) - ] - decodeMessage _ = DiffTreeTOCResponse - <$> (nestedvec <$> at decodeMessageField 1) - dotProto = undefined - -data TOCSummaryFile = TOCSummaryFile - { path :: Text - , language :: Text - , changes :: Vector TOCSummaryChange - , errors :: Vector TOCSummaryError - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB TOCSummaryFile where - parseJSONPB = A.withObject "TOCSummaryFile" $ \obj -> TOCSummaryFile - <$> obj .: "path" - <*> obj .: "language" - <*> obj .: "changes" - <*> obj .: "errors" - -instance ToJSONPB TOCSummaryFile where - toJSONPB TOCSummaryFile{..} = object - [ - "path" .= path - , "language" .= language - , "changes" .= changes - , "errors" .= errors - ] - toEncodingPB TOCSummaryFile{..} = pairs - [ - "path" .= path - , "language" .= language - , "changes" .= changes - , "errors" .= errors - ] - -instance FromJSON TOCSummaryFile where - parseJSON = parseJSONPB - -instance ToJSON TOCSummaryFile where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message TOCSummaryFile where - encodeMessage _ TOCSummaryFile{..} = mconcat - [ - encodeMessageField 1 path - , encodeMessageField 2 language - , encodeMessageField 3 (Proto3.NestedVec changes) - , encodeMessageField 4 (Proto3.NestedVec errors) - ] - decodeMessage _ = TOCSummaryFile - <$> at decodeMessageField 1 - <*> at decodeMessageField 2 - <*> (nestedvec <$> at decodeMessageField 3) - <*> (nestedvec <$> at decodeMessageField 4) - dotProto = undefined - -data TOCSummaryChange = TOCSummaryChange - { category :: Text - , term :: Text - , span :: Maybe Span - , changeType :: ChangeType - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB TOCSummaryChange where - parseJSONPB = A.withObject "TOCSummaryChange" $ \obj -> TOCSummaryChange - <$> obj .: "category" - <*> obj .: "term" - <*> obj .: "span" - <*> obj .: "changeType" - -instance ToJSONPB TOCSummaryChange where - toJSONPB TOCSummaryChange{..} = object - [ - "category" .= category - , "term" .= term - , "span" .= span - , "changeType" .= changeType - ] - toEncodingPB TOCSummaryChange{..} = pairs - [ - "category" .= category - , "term" .= term - , "span" .= span - , "changeType" .= changeType - ] - -instance FromJSON TOCSummaryChange where - parseJSON = parseJSONPB - -instance ToJSON TOCSummaryChange where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message TOCSummaryChange where - encodeMessage _ TOCSummaryChange{..} = mconcat - [ - encodeMessageField 1 category - , encodeMessageField 2 term - , encodeMessageField 3 (Proto3.Nested span) - , encodeMessageField 4 changeType - ] - decodeMessage _ = TOCSummaryChange - <$> at decodeMessageField 1 - <*> at decodeMessageField 2 - <*> at decodeMessageField 3 - <*> at decodeMessageField 4 - dotProto = undefined - -data TOCSummaryError = TOCSummaryError - { error :: Text - , span :: Maybe Span - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB TOCSummaryError where - parseJSONPB = A.withObject "TOCSummaryError" $ \obj -> TOCSummaryError - <$> obj .: "error" - <*> obj .: "span" - -instance ToJSONPB TOCSummaryError where - toJSONPB TOCSummaryError{..} = object - [ - "error" .= error - , "span" .= span - ] - toEncodingPB TOCSummaryError{..} = pairs - [ - "error" .= error - , "span" .= span - ] - -instance FromJSON TOCSummaryError where - parseJSON = parseJSONPB - -instance ToJSON TOCSummaryError where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message TOCSummaryError where - encodeMessage _ TOCSummaryError{..} = mconcat - [ - encodeMessageField 1 error - , encodeMessageField 2 (Proto3.Nested span) - ] - decodeMessage _ = TOCSummaryError - <$> at decodeMessageField 1 - <*> at decodeMessageField 2 - dotProto = undefined - -data DiffTreeGraphResponse = DiffTreeGraphResponse - { files :: Vector DiffTreeFileGraph - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB DiffTreeGraphResponse where - parseJSONPB = A.withObject "DiffTreeGraphResponse" $ \obj -> DiffTreeGraphResponse - <$> obj .: "files" - -instance ToJSONPB DiffTreeGraphResponse where - toJSONPB DiffTreeGraphResponse{..} = object - [ - "files" .= files - ] - toEncodingPB DiffTreeGraphResponse{..} = pairs - [ - "files" .= files - ] - -instance FromJSON DiffTreeGraphResponse where - parseJSON = parseJSONPB - -instance ToJSON DiffTreeGraphResponse where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message DiffTreeGraphResponse where - encodeMessage _ DiffTreeGraphResponse{..} = mconcat - [ - encodeMessageField 1 (Proto3.NestedVec files) - ] - decodeMessage _ = DiffTreeGraphResponse - <$> (nestedvec <$> at decodeMessageField 1) - dotProto = undefined - -data DiffTreeFileGraph = DiffTreeFileGraph - { path :: Text - , language :: Text - , vertices :: Vector DiffTreeVertex - , edges :: Vector DiffTreeEdge - , errors :: Vector ParseError - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB DiffTreeFileGraph where - parseJSONPB = A.withObject "DiffTreeFileGraph" $ \obj -> DiffTreeFileGraph - <$> obj .: "path" - <*> obj .: "language" - <*> obj .: "vertices" - <*> obj .: "edges" - <*> obj .: "errors" - -instance ToJSONPB DiffTreeFileGraph where - toJSONPB DiffTreeFileGraph{..} = object - [ - "path" .= path - , "language" .= language - , "vertices" .= vertices - , "edges" .= edges - , "errors" .= errors - ] - toEncodingPB DiffTreeFileGraph{..} = pairs - [ - "path" .= path - , "language" .= language - , "vertices" .= vertices - , "edges" .= edges - , "errors" .= errors - ] - -instance FromJSON DiffTreeFileGraph where - parseJSON = parseJSONPB - -instance ToJSON DiffTreeFileGraph where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message DiffTreeFileGraph where - encodeMessage _ DiffTreeFileGraph{..} = mconcat - [ - encodeMessageField 1 path - , encodeMessageField 2 language - , encodeMessageField 3 (Proto3.NestedVec vertices) - , encodeMessageField 4 (Proto3.NestedVec edges) - , encodeMessageField 5 (Proto3.NestedVec errors) - ] - decodeMessage _ = DiffTreeFileGraph - <$> at decodeMessageField 1 - <*> at decodeMessageField 2 - <*> (nestedvec <$> at decodeMessageField 3) - <*> (nestedvec <$> at decodeMessageField 4) - <*> (nestedvec <$> at decodeMessageField 5) - dotProto = undefined - -data DiffTreeEdge = DiffTreeEdge - { source :: Int32 - , target :: Int32 - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB DiffTreeEdge where - parseJSONPB = A.withObject "DiffTreeEdge" $ \obj -> DiffTreeEdge - <$> obj .: "source" - <*> obj .: "target" - -instance ToJSONPB DiffTreeEdge where - toJSONPB DiffTreeEdge{..} = object - [ - "source" .= source - , "target" .= target - ] - toEncodingPB DiffTreeEdge{..} = pairs - [ - "source" .= source - , "target" .= target - ] - -instance FromJSON DiffTreeEdge where - parseJSON = parseJSONPB - -instance ToJSON DiffTreeEdge where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message DiffTreeEdge where - encodeMessage _ DiffTreeEdge{..} = mconcat - [ - encodeMessageField 1 source - , encodeMessageField 2 target - ] - decodeMessage _ = DiffTreeEdge - <$> at decodeMessageField 1 - <*> at decodeMessageField 2 - dotProto = undefined - -data DiffTreeVertexDiffTerm - = Deleted (Maybe DeletedTerm) - | Inserted (Maybe InsertedTerm) - | Replaced (Maybe ReplacedTerm) - | Merged (Maybe MergedTerm) - deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Message, Proto3.Named, NFData) - -instance FromJSONPB DiffTreeVertexDiffTerm where - parseJSONPB = A.withObject "DiffTreeVertexDiffTerm" $ \obj -> msum - [ - Deleted <$> parseField obj "deleted" - , Inserted <$> parseField obj "inserted" - , Replaced <$> parseField obj "replaced" - , Merged <$> parseField obj "merged" - ] - -instance ToJSONPB DiffTreeVertexDiffTerm where - toJSONPB (Deleted x) = object [ "deleted" .= x ] - toJSONPB (Inserted x) = object [ "inserted" .= x ] - toJSONPB (Replaced x) = object [ "replaced" .= x ] - toJSONPB (Merged x) = object [ "merged" .= x ] - toEncodingPB (Deleted x) = pairs [ "deleted" .= x ] - toEncodingPB (Inserted x) = pairs [ "inserted" .= x ] - toEncodingPB (Replaced x) = pairs [ "replaced" .= x ] - toEncodingPB (Merged x) = pairs [ "merged" .= x ] - -instance FromJSON DiffTreeVertexDiffTerm where - parseJSON = parseJSONPB - -instance ToJSON DiffTreeVertexDiffTerm where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -data DiffTreeVertex = DiffTreeVertex - { diffVertexId :: Int32 - , diffTerm :: Maybe DiffTreeVertexDiffTerm - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB DiffTreeVertex where - parseJSONPB = A.withObject "DiffTreeVertex" $ \obj -> DiffTreeVertex - <$> obj .: "diffVertexId" - <*> obj .: "diffTerm" - -instance ToJSONPB DiffTreeVertex where - toJSONPB DiffTreeVertex{..} = object - [ - "diffVertexId" .= diffVertexId - , "diffTerm" .= diffTerm - ] - toEncodingPB DiffTreeVertex{..} = pairs - [ - "diffVertexId" .= diffVertexId - , "diffTerm" .= diffTerm - ] - -instance FromJSON DiffTreeVertex where - parseJSON = parseJSONPB - -instance ToJSON DiffTreeVertex where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message DiffTreeVertex where - encodeMessage _ DiffTreeVertex{..} = mconcat - [ - encodeMessageField 1 diffVertexId - , case diffTerm of - Nothing -> mempty - Just (Deleted deleted) -> encodeMessageField 2 deleted - Just (Inserted inserted) -> encodeMessageField 3 inserted - Just (Replaced replaced) -> encodeMessageField 4 replaced - Just (Merged merged) -> encodeMessageField 5 merged - ] - decodeMessage _ = DiffTreeVertex - <$> at decodeMessageField 1 - <*> oneof - Nothing - [ - (2, Just . Deleted <$> decodeMessageField) - , (3, Just . Inserted <$> decodeMessageField) - , (4, Just . Replaced <$> decodeMessageField) - , (5, Just . Merged <$> decodeMessageField) - ] - dotProto = undefined - -data DeletedTerm = DeletedTerm - { term :: Text - , span :: Maybe Span - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB DeletedTerm where - parseJSONPB = A.withObject "DeletedTerm" $ \obj -> DeletedTerm - <$> obj .: "term" - <*> obj .: "span" - -instance ToJSONPB DeletedTerm where - toJSONPB DeletedTerm{..} = object - [ - "term" .= term - , "span" .= span - ] - toEncodingPB DeletedTerm{..} = pairs - [ - "term" .= term - , "span" .= span - ] - -instance FromJSON DeletedTerm where - parseJSON = parseJSONPB - -instance ToJSON DeletedTerm where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message DeletedTerm where - encodeMessage _ DeletedTerm{..} = mconcat - [ - encodeMessageField 1 term - , encodeMessageField 2 (Proto3.Nested span) - ] - decodeMessage _ = DeletedTerm - <$> at decodeMessageField 1 - <*> at decodeMessageField 2 - dotProto = undefined - -data InsertedTerm = InsertedTerm - { term :: Text - , span :: Maybe Span - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB InsertedTerm where - parseJSONPB = A.withObject "InsertedTerm" $ \obj -> InsertedTerm - <$> obj .: "term" - <*> obj .: "span" - -instance ToJSONPB InsertedTerm where - toJSONPB InsertedTerm{..} = object - [ - "term" .= term - , "span" .= span - ] - toEncodingPB InsertedTerm{..} = pairs - [ - "term" .= term - , "span" .= span - ] - -instance FromJSON InsertedTerm where - parseJSON = parseJSONPB - -instance ToJSON InsertedTerm where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message InsertedTerm where - encodeMessage _ InsertedTerm{..} = mconcat - [ - encodeMessageField 1 term - , encodeMessageField 2 (Proto3.Nested span) - ] - decodeMessage _ = InsertedTerm - <$> at decodeMessageField 1 - <*> at decodeMessageField 2 - dotProto = undefined - -data ReplacedTerm = ReplacedTerm - { beforeTerm :: Text - , beforeSpan :: Maybe Span - , afterTerm :: Text - , afterSpan :: Maybe Span - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB ReplacedTerm where - parseJSONPB = A.withObject "ReplacedTerm" $ \obj -> ReplacedTerm - <$> obj .: "beforeTerm" - <*> obj .: "beforeSpan" - <*> obj .: "afterTerm" - <*> obj .: "afterSpan" - -instance ToJSONPB ReplacedTerm where - toJSONPB ReplacedTerm{..} = object - [ - "beforeTerm" .= beforeTerm - , "beforeSpan" .= beforeSpan - , "afterTerm" .= afterTerm - , "afterSpan" .= afterSpan - ] - toEncodingPB ReplacedTerm{..} = pairs - [ - "beforeTerm" .= beforeTerm - , "beforeSpan" .= beforeSpan - , "afterTerm" .= afterTerm - , "afterSpan" .= afterSpan - ] - -instance FromJSON ReplacedTerm where - parseJSON = parseJSONPB - -instance ToJSON ReplacedTerm where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message ReplacedTerm where - encodeMessage _ ReplacedTerm{..} = mconcat - [ - encodeMessageField 1 beforeTerm - , encodeMessageField 2 (Proto3.Nested beforeSpan) - , encodeMessageField 3 afterTerm - , encodeMessageField 4 (Proto3.Nested afterSpan) - ] - decodeMessage _ = ReplacedTerm - <$> at decodeMessageField 1 - <*> at decodeMessageField 2 - <*> at decodeMessageField 3 - <*> at decodeMessageField 4 - dotProto = undefined - -data MergedTerm = MergedTerm - { term :: Text - , beforeSpan :: Maybe Span - , afterSpan :: Maybe Span - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB MergedTerm where - parseJSONPB = A.withObject "MergedTerm" $ \obj -> MergedTerm - <$> obj .: "term" - <*> obj .: "beforeSpan" - <*> obj .: "afterSpan" - -instance ToJSONPB MergedTerm where - toJSONPB MergedTerm{..} = object - [ - "term" .= term - , "beforeSpan" .= beforeSpan - , "afterSpan" .= afterSpan - ] - toEncodingPB MergedTerm{..} = pairs - [ - "term" .= term - , "beforeSpan" .= beforeSpan - , "afterSpan" .= afterSpan - ] - -instance FromJSON MergedTerm where - parseJSON = parseJSONPB - -instance ToJSON MergedTerm where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message MergedTerm where - encodeMessage _ MergedTerm{..} = mconcat - [ - encodeMessageField 1 term - , encodeMessageField 2 (Proto3.Nested beforeSpan) - , encodeMessageField 3 (Proto3.Nested afterSpan) - ] - decodeMessage _ = MergedTerm - <$> at decodeMessageField 1 - <*> at decodeMessageField 2 - <*> at decodeMessageField 3 - dotProto = undefined - -data Blob = Blob - { content :: Text - , path :: Text - , language :: Text - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB Blob where - parseJSONPB = A.withObject "Blob" $ \obj -> Blob - <$> obj .: "content" - <*> obj .: "path" - <*> obj .: "language" - -instance ToJSONPB Blob where - toJSONPB Blob{..} = object - [ - "content" .= content - , "path" .= path - , "language" .= language - ] - toEncodingPB Blob{..} = pairs - [ - "content" .= content - , "path" .= path - , "language" .= language - ] - -instance FromJSON Blob where - parseJSON = parseJSONPB - -instance ToJSON Blob where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message Blob where - encodeMessage _ Blob{..} = mconcat - [ - encodeMessageField 1 content - , encodeMessageField 2 path - , encodeMessageField 3 language - ] - decodeMessage _ = Blob - <$> at decodeMessageField 1 - <*> at decodeMessageField 2 - <*> at decodeMessageField 3 - dotProto = undefined - -data BlobPair = BlobPair - { before :: Maybe Blob - , after :: Maybe Blob - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB BlobPair where - parseJSONPB = A.withObject "BlobPair" $ \obj -> BlobPair - <$> obj .: "before" - <*> obj .: "after" - -instance ToJSONPB BlobPair where - toJSONPB BlobPair{..} = object - [ - "before" .= before - , "after" .= after - ] - toEncodingPB BlobPair{..} = pairs - [ - "before" .= before - , "after" .= after - ] - -instance FromJSON BlobPair where - parseJSON = parseJSONPB - -instance ToJSON BlobPair where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message BlobPair where - encodeMessage _ BlobPair{..} = mconcat - [ - encodeMessageField 1 (Proto3.Nested before) - , encodeMessageField 2 (Proto3.Nested after) - ] - decodeMessage _ = BlobPair - <$> at decodeMessageField 1 - <*> at decodeMessageField 2 - dotProto = undefined - -data File = File - { path :: Text - , language :: Text - , symbols :: Vector Symbol - , errors :: Vector ParseError - , blobOid :: Text - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB File where - parseJSONPB = A.withObject "File" $ \obj -> File - <$> obj .: "path" - <*> obj .: "language" - <*> obj .: "symbols" - <*> obj .: "errors" - <*> obj .: "blobOid" - -instance ToJSONPB File where - toJSONPB File{..} = object - [ - "path" .= path - , "language" .= language - , "symbols" .= symbols - , "errors" .= errors - , "blobOid" .= blobOid - ] - toEncodingPB File{..} = pairs - [ - "path" .= path - , "language" .= language - , "symbols" .= symbols - , "errors" .= errors - , "blobOid" .= blobOid - ] - -instance FromJSON File where - parseJSON = parseJSONPB - -instance ToJSON File where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message File where - encodeMessage _ File{..} = mconcat - [ - encodeMessageField 1 path - , encodeMessageField 2 language - , encodeMessageField 3 (Proto3.NestedVec symbols) - , encodeMessageField 4 (Proto3.NestedVec errors) - , encodeMessageField 5 blobOid - ] - decodeMessage _ = File - <$> at decodeMessageField 1 - <*> at decodeMessageField 2 - <*> (nestedvec <$> at decodeMessageField 3) - <*> (nestedvec <$> at decodeMessageField 4) - <*> at decodeMessageField 5 - dotProto = undefined - -data Symbol = Symbol - { symbol :: Text - , kind :: Text - , line :: Text - , span :: Maybe Span - , docs :: Maybe Docstring - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB Symbol where - parseJSONPB = A.withObject "Symbol" $ \obj -> Symbol - <$> obj .: "symbol" - <*> obj .: "kind" - <*> obj .: "line" - <*> obj .: "span" - <*> obj .: "docs" - -instance ToJSONPB Symbol where - toJSONPB Symbol{..} = object - [ - "symbol" .= symbol - , "kind" .= kind - , "line" .= line - , "span" .= span - , "docs" .= docs - ] - toEncodingPB Symbol{..} = pairs - [ - "symbol" .= symbol - , "kind" .= kind - , "line" .= line - , "span" .= span - , "docs" .= docs - ] - -instance FromJSON Symbol where - parseJSON = parseJSONPB - -instance ToJSON Symbol where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message Symbol where - encodeMessage _ Symbol{..} = mconcat - [ - encodeMessageField 1 symbol - , encodeMessageField 2 kind - , encodeMessageField 3 line - , encodeMessageField 4 (Proto3.Nested span) - , encodeMessageField 5 (Proto3.Nested docs) - ] - decodeMessage _ = Symbol - <$> at decodeMessageField 1 - <*> at decodeMessageField 2 - <*> at decodeMessageField 3 - <*> at decodeMessageField 4 - <*> at decodeMessageField 5 - dotProto = undefined - -data Docstring = Docstring - { docstring :: Text - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB Docstring where - parseJSONPB = A.withObject "Docstring" $ \obj -> Docstring - <$> obj .: "docstring" - -instance ToJSONPB Docstring where - toJSONPB Docstring{..} = object - [ - "docstring" .= docstring - ] - toEncodingPB Docstring{..} = pairs - [ - "docstring" .= docstring - ] - -instance FromJSON Docstring where - parseJSON = parseJSONPB - -instance ToJSON Docstring where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message Docstring where - encodeMessage _ Docstring{..} = mconcat - [ - encodeMessageField 1 docstring - ] - decodeMessage _ = Docstring - <$> at decodeMessageField 1 - dotProto = undefined - -data Position = Position - { line :: Int32 - , column :: Int32 - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB Position where - parseJSONPB = A.withObject "Position" $ \obj -> Position - <$> obj .: "line" - <*> obj .: "column" - -instance ToJSONPB Position where - toJSONPB Position{..} = object - [ - "line" .= line - , "column" .= column - ] - toEncodingPB Position{..} = pairs - [ - "line" .= line - , "column" .= column - ] - -instance FromJSON Position where - parseJSON = parseJSONPB - -instance ToJSON Position where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message Position where - encodeMessage _ Position{..} = mconcat - [ - encodeMessageField 1 line - , encodeMessageField 2 column - ] - decodeMessage _ = Position - <$> at decodeMessageField 1 - <*> at decodeMessageField 2 - dotProto = undefined - -data Span = Span - { start :: Maybe Position - , end :: Maybe Position - } deriving stock (Eq, Ord, Show, Generic) - deriving anyclass (Proto3.Named, NFData) - -instance FromJSONPB Span where - parseJSONPB = A.withObject "Span" $ \obj -> Span - <$> obj .: "start" - <*> obj .: "end" - -instance ToJSONPB Span where - toJSONPB Span{..} = object - [ - "start" .= start - , "end" .= end - ] - toEncodingPB Span{..} = pairs - [ - "start" .= start - , "end" .= end - ] - -instance FromJSON Span where - parseJSON = parseJSONPB - -instance ToJSON Span where - toJSON = toAesonValue - toEncoding = toAesonEncoding - -instance Proto3.Message Span where - encodeMessage _ Span{..} = mconcat - [ - encodeMessageField 1 (Proto3.Nested start) - , encodeMessageField 2 (Proto3.Nested end) - ] - decodeMessage _ = Span - <$> at decodeMessageField 1 - <*> at decodeMessageField 2 - dotProto = undefined - -data ChangeType - = None - | Added - | Removed - | Modified - deriving stock (Eq, Ord, Show, Enum, Bounded, Generic) - deriving anyclass (Proto3.Named, Proto3.MessageField, NFData) - deriving Proto3.Primitive via Proto3.PrimitiveEnum ChangeType - -instance Proto3.HasDefault ChangeType where def = None - -instance FromJSONPB ChangeType where - parseJSONPB (JSONPB.String "NONE") = pure None - parseJSONPB (JSONPB.String "ADDED") = pure Added - parseJSONPB (JSONPB.String "REMOVED") = pure Removed - parseJSONPB (JSONPB.String "MODIFIED") = pure Modified - parseJSONPB x = typeMismatch "ChangeType" x - -instance ToJSONPB ChangeType where - toJSONPB x _ = A.String . T.toUpper . T.pack $ show x - toEncodingPB x _ = E.text . T.toUpper . T.pack $ show x - -instance FromJSON ChangeType where - parseJSON = parseJSONPB - -instance ToJSON ChangeType where - toJSON = toAesonValue - toEncoding = toAesonEncoding diff --git a/src/Serializing/Format.hs b/src/Serializing/Format.hs index c80860cb9c..45974a5185 100644 --- a/src/Serializing/Format.hs +++ b/src/Serializing/Format.hs @@ -15,7 +15,6 @@ import Language.Haskell.HsColour import Language.Haskell.HsColour.Colourise import Prologue import Data.ProtoLens.Encoding as Proto -import Data.ProtoLens.JSON as Proto (messageToEncoding) import Data.ProtoLens.Message (Message) import Serializing.SExpression import Text.Show.Pretty @@ -23,7 +22,6 @@ import Text.Show.Pretty data Format input where DOT :: (Ord vertex, ToGraph graph, ToVertex graph ~ vertex) => Style vertex Builder -> Format graph JSON :: ToJSON input => Format input - JSONPB :: Message input => Format input SExpression :: (Recursive input, ToSExpression (Base input)) => Options -> Format input Show :: Show input => Format input Proto :: Message input => Format input @@ -36,5 +34,4 @@ runSerialize _ JSON = (<> "\n") . fromEncoding . toEncodin runSerialize _ (SExpression opts) = serializeSExpression opts runSerialize Colourful Show = (<> "\n") . stringUtf8 . hscolour TTY defaultColourPrefs False False "" False . ppShow runSerialize Plain Show = (<> "\n") . stringUtf8 . show -runSerialize _ JSONPB = fromEncoding . Proto.messageToEncoding -runSerialize _ Proto = Proto.buildMessage -- lazyByteString . Proto3.toLazyByteString +runSerialize _ Proto = Proto.buildMessage diff --git a/test/Rendering/TOC/Spec.hs b/test/Rendering/TOC/Spec.hs index 7d94a1dada..1a5ff719a2 100644 --- a/test/Rendering/TOC/Spec.hs +++ b/test/Rendering/TOC/Spec.hs @@ -147,22 +147,22 @@ spec = do describe "diff with ToCDiffRenderer'" $ do it "produces JSON output" $ do blobs <- blobsForPaths (Both (Path.relFile "ruby/toc/methods.A.rb") (Path.relFile "ruby/toc/methods.B.rb")) - output <- runTaskOrDie (diffSummaryBuilder Format.JSONPB [blobs]) + output <- runTaskOrDie (diffSummaryBuilder Format.JSON [blobs]) runBuilder output `shouldBe` ("{\"files\":[{\"path\":\"test/fixtures/ruby/toc/methods.A.rb -> test/fixtures/ruby/toc/methods.B.rb\",\"language\":\"Ruby\",\"changes\":[{\"category\":\"Method\",\"term\":\"self.foo\",\"span\":{\"start\":{\"line\":1,\"column\":1},\"end\":{\"line\":2,\"column\":4}},\"changeType\":\"ADDED\"},{\"category\":\"Method\",\"term\":\"bar\",\"span\":{\"start\":{\"line\":4,\"column\":1},\"end\":{\"line\":6,\"column\":4}},\"changeType\":\"MODIFIED\"},{\"category\":\"Method\",\"term\":\"baz\",\"span\":{\"start\":{\"line\":4,\"column\":1},\"end\":{\"line\":5,\"column\":4}},\"changeType\":\"REMOVED\"}]}]}\n" :: ByteString) it "produces JSON output if there are parse errors" $ do blobs <- blobsForPaths (Both (Path.relFile "ruby/toc/methods.A.rb") (Path.relFile "ruby/toc/methods.X.rb")) - output <- runTaskOrDie (diffSummaryBuilder Format.JSONPB [blobs]) + output <- runTaskOrDie (diffSummaryBuilder Format.JSON [blobs]) runBuilder output `shouldBe` ("{\"files\":[{\"path\":\"test/fixtures/ruby/toc/methods.A.rb -> test/fixtures/ruby/toc/methods.X.rb\",\"language\":\"Ruby\",\"changes\":[{\"category\":\"Method\",\"term\":\"bar\",\"span\":{\"start\":{\"line\":1,\"column\":1},\"end\":{\"line\":2,\"column\":4}},\"changeType\":\"REMOVED\"},{\"category\":\"Method\",\"term\":\"baz\",\"span\":{\"start\":{\"line\":4,\"column\":1},\"end\":{\"line\":5,\"column\":4}},\"changeType\":\"REMOVED\"}],\"errors\":[{\"error\":\"expected end of input nodes, but got ParseError\",\"span\":{\"start\":{\"line\":1,\"column\":1},\"end\":{\"line\":2,\"column\":3}}}]}]}\n" :: ByteString) it "ignores anonymous functions" $ do blobs <- blobsForPaths (Both (Path.relFile "ruby/toc/lambda.A.rb") (Path.relFile "ruby/toc/lambda.B.rb")) - output <- runTaskOrDie (diffSummaryBuilder Format.JSONPB [blobs]) + output <- runTaskOrDie (diffSummaryBuilder Format.JSON [blobs]) runBuilder output `shouldBe` ("{\"files\":[{\"path\":\"test/fixtures/ruby/toc/lambda.A.rb -> test/fixtures/ruby/toc/lambda.B.rb\",\"language\":\"Ruby\"}]}\n" :: ByteString) it "summarizes Markdown headings" $ do blobs <- blobsForPaths (Both (Path.relFile "markdown/toc/headings.A.md") (Path.relFile "markdown/toc/headings.B.md")) - output <- runTaskOrDie (diffSummaryBuilder Format.JSONPB [blobs]) + output <- runTaskOrDie (diffSummaryBuilder Format.JSON [blobs]) runBuilder output `shouldBe` ("{\"files\":[{\"path\":\"test/fixtures/markdown/toc/headings.A.md -> test/fixtures/markdown/toc/headings.B.md\",\"language\":\"Markdown\",\"changes\":[{\"category\":\"Heading 1\",\"term\":\"Introduction\",\"span\":{\"start\":{\"line\":1,\"column\":1},\"end\":{\"line\":3,\"column\":16}},\"changeType\":\"REMOVED\"},{\"category\":\"Heading 2\",\"term\":\"Two\",\"span\":{\"start\":{\"line\":5,\"column\":1},\"end\":{\"line\":7,\"column\":4}},\"changeType\":\"MODIFIED\"},{\"category\":\"Heading 3\",\"term\":\"This heading is new\",\"span\":{\"start\":{\"line\":9,\"column\":1},\"end\":{\"line\":11,\"column\":10}},\"changeType\":\"ADDED\"},{\"category\":\"Heading 1\",\"term\":\"Final\",\"span\":{\"start\":{\"line\":13,\"column\":1},\"end\":{\"line\":14,\"column\":4}},\"changeType\":\"ADDED\"}]}]}\n" :: ByteString) diff --git a/test/Semantic/CLI/Spec.hs b/test/Semantic/CLI/Spec.hs index ca139c6686..d910348b71 100644 --- a/test/Semantic/CLI/Spec.hs +++ b/test/Semantic/CLI/Spec.hs @@ -55,7 +55,7 @@ parseFixtures = , ("json", run . parseTermBuilder TermJSONTree, path, prefix Path.file "parse-tree.json") , ("json", run . parseTermBuilder TermJSONTree, path', prefix Path.file "parse-trees.json") , ("json", run . parseTermBuilder TermJSONTree, [], prefix Path.file "parse-tree-empty.json") - , ("symbols", run . parseSymbolsBuilder Serializing.Format.JSONPB, path'', prefix Path.file "parse-tree.symbols.json") + , ("symbols", run . parseSymbolsBuilder Serializing.Format.JSON, path'', prefix Path.file "parse-tree.symbols.json") , ("protobuf symbols", run . parseSymbolsBuilder Serializing.Format.Proto, path'', prefix Path.file "parse-tree.symbols.protobuf.bin") ] where path = [File "test/fixtures/ruby/corpus/and-or.A.rb" Ruby] @@ -68,7 +68,7 @@ diffFixtures :: [(String, [BlobPair] -> TaskEff Builder, [Both File], Path.RelFi diffFixtures = [ ("json diff", parseDiffBuilder DiffJSONTree, pathMode, prefix Path.file "diff-tree.json") , ("s-expression diff", parseDiffBuilder DiffSExpression, pathMode, Path.relFile "test/fixtures/ruby/corpus/method-declaration.diffA-B.txt") - , ("toc summaries diff", diffSummaryBuilder Serializing.Format.JSONPB, pathMode, prefix Path.file "diff-tree.toc.json") + , ("toc summaries diff", diffSummaryBuilder Serializing.Format.JSON, pathMode, prefix Path.file "diff-tree.toc.json") , ("protobuf diff", diffSummaryBuilder Serializing.Format.Proto, pathMode, prefix Path.file "diff-tree.toc.protobuf.bin") ] where pathMode = [Both (File "test/fixtures/ruby/corpus/method-declaration.A.rb" Ruby) (File "test/fixtures/ruby/corpus/method-declaration.B.rb" Ruby)] From 6488e6e5b1352f337c963d7085a8dfd3a5f260db Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Tue, 1 Oct 2019 15:46:35 -0700 Subject: [PATCH 07/13] Thanks @patrickt --- src/Semantic/Api/Symbols.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Semantic/Api/Symbols.hs b/src/Semantic/Api/Symbols.hs index dbd44c1f00..74352c80f6 100644 --- a/src/Semantic/Api/Symbols.hs +++ b/src/Semantic/Api/Symbols.hs @@ -105,9 +105,7 @@ parseSymbols blobs = do -- ParseTreeSymbolResponse . V.fromList . toList <$> dis & P.kind .~ pack (show kind) & P.line .~ line & P.maybe'span .~ converting #? span - & P.maybe'docs .~ case docs of - Just d -> Just (defMessage & P.docstring .~ d) - Nothing -> Nothing + & P.maybe'docs .~ fmap (flip (set P.docstring) defMessage) docs symbolsToSummarize :: [Text] symbolsToSummarize = ["Function", "Method", "Class", "Module", "Call", "Send"] From 85bf7e72ecc3fbd3a4ec54b1a8cd90a9e602e139 Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Wed, 2 Oct 2019 13:14:16 -0700 Subject: [PATCH 08/13] Use tclem/proto-lens-jsonpb --- .gitignore | 1 + Dockerfile | 2 +- cabal.project | 4 +- script/protoc | 4 +- semantic.cabal | 1 + src/Proto/Semantic_JSON.hs | 1080 ++++++++++++++++++++++++------------ 6 files changed, 718 insertions(+), 374 deletions(-) diff --git a/.gitignore b/.gitignore index 9352acf31d..6ad025336b 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ tmp/ *.hp *.prof *.pyc +/hie.yaml /test.* /*.html diff --git a/Dockerfile b/Dockerfile index d368f704d8..ec5acb1e3a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ RUN wget "https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/p RUN go get github.com/golang/protobuf/proto && \ go get github.com/twitchtv/protogen/typemap && \ - GO111MODULE=on go get github.com/tclem/twirp-haskell/protoc-gen-twirp_haskell@proto-lens + GO111MODULE=on go get github.com/tclem/proto-lens-jsonpb/protoc-gen-jsonpb_haskell@master COPY --from=haskell /root/.cabal/bin/proto-lens-protoc /usr/local/bin/proto-lens-protoc diff --git a/cabal.project b/cabal.project index ab843049c7..e359da64eb 100644 --- a/cabal.project +++ b/cabal.project @@ -4,5 +4,5 @@ jobs: $ncpus source-repository-package type: git - location: https://github.com/tclem/proto-lens-json - tag: 6b56fa64c2a2edad6dd460a97650327cb4c6361c + location: https://github.com/tclem/proto-lens-jsonpb + tag: 2b4cd579144ea10c3bd36bd05122c233dc5334d7 diff --git a/script/protoc b/script/protoc index 0acc00cac3..283de0d501 100755 --- a/script/protoc +++ b/script/protoc @@ -14,5 +14,7 @@ export PROJECT="github.com/github/semantic" # Generate Haskell for semantic's protobuf types docker run --rm --user $(id -u):$(id -g) -v $(pwd):/go/src/$PROJECT -w /go/src/$PROJECT \ - semantic-protoc --proto_path=proto --haskell_out=./src \ + semantic-protoc --proto_path=proto \ + --haskell_out=./src \ + --jsonpb_haskell_out=./src \ semantic.proto diff --git a/semantic.cabal b/semantic.cabal index 8a36b55be0..fc4a69d2e5 100644 --- a/semantic.cabal +++ b/semantic.cabal @@ -302,6 +302,7 @@ library , prettyprinter ^>= 1.2.1 , pretty-show ^>= 1.9.5 , profunctors ^>= 5.3 + , proto-lens-jsonpb , reducers ^>= 3.12.3 , semantic-tags ^>= 0 , semigroupoids ^>= 5.3.2 diff --git a/src/Proto/Semantic_JSON.hs b/src/Proto/Semantic_JSON.hs index cce56fe773..6c2493fe98 100644 --- a/src/Proto/Semantic_JSON.hs +++ b/src/Proto/Semantic_JSON.hs @@ -1,423 +1,468 @@ -{-# OPTIONS_GHC -Wno-missing-export-lists #-} -{-# OPTIONS_GHC -Wno-orphans #-} +-- Code generated by protoc-gen-jsonpb_haskell 0.1.0, DO NOT EDIT. +{-# OPTIONS_GHC -Wno-orphans -Wno-unused-imports -Wno-missing-export-lists #-} module Proto.Semantic_JSON where -import Control.Lens hiding ((.=)) +import Prelude(($), (.), (<$>), pure, show) + +import Data.ProtoLens.Runtime.Lens.Family2 ((^.), (.~), (&)) +import Data.Monoid (mconcat) import Control.Monad (msum) -import Data.Aeson as A -import qualified Data.Aeson.Encoding as E -import Data.Aeson.Types (parseField) import Data.ProtoLens (defMessage) +import qualified Data.Aeson as A +import qualified Data.Aeson.Encoding as E +import Data.ProtoLens.JSONPB as JSONPB import qualified Data.Text as T -import Prelude hiding (error, span) + import Proto.Semantic as P import Proto.Semantic_Fields as P +instance FromJSONPB PingRequest where + parseJSONPB = withObject "PingRequest" $ \obj -> do + service' <- obj .: "service" + pure $ defMessage + & P.service .~ service' + +instance ToJSONPB PingRequest where + toJSONPB x = object + [ "service" .= (x^.service) + ] + toEncodingPB x = pairs + [ "service" .= (x^.service) + ] instance FromJSON PingRequest where - parseJSON = withObject "PingRequest" $ \obj -> do - service <- obj .: "service" - pure $ defMessage & P.service .~ service + parseJSON = parseJSONPB instance ToJSON PingRequest where - toJSON x = object [ "service" .= (x^.service) ] - toEncoding x = pairs $ "service" .= (x^.service) - -instance FromJSON PingResponse where - parseJSON = A.withObject "PingResponse" $ \obj -> do - status <- obj .: "status" - hostname <- obj .: "hostname" - timestamp <- obj .: "timestamp" - sha <- obj .: "sha" + toJSON = toAesonValue + toEncoding = toAesonEncoding + +instance FromJSONPB PingResponse where + parseJSONPB = withObject "PingResponse" $ \obj -> do + status' <- obj .: "status" + hostname' <- obj .: "hostname" + timestamp' <- obj .: "timestamp" + sha' <- obj .: "sha" pure $ defMessage - & P.status .~ status - & P.hostname .~ hostname - & P.timestamp .~ timestamp - & P.sha .~ sha + & P.status .~ status' + & P.hostname .~ hostname' + & P.timestamp .~ timestamp' + & P.sha .~ sha' -instance ToJSON PingResponse where - toJSON x = object +instance ToJSONPB PingResponse where + toJSONPB x = object [ "status" .= (x^.status) , "hostname" .= (x^.hostname) , "timestamp" .= (x^.timestamp) , "sha" .= (x^.sha) ] - toEncoding x = pairs $ - "status" .= (x^.status) - <> "hostname" .= (x^.hostname) - <> "timestamp" .= (x^.timestamp) - <> "sha" .= (x^.sha) + toEncodingPB x = pairs + [ "status" .= (x^.status) + , "hostname" .= (x^.hostname) + , "timestamp" .= (x^.timestamp) + , "sha" .= (x^.sha) + ] + +instance FromJSON PingResponse where + parseJSON = parseJSONPB + +instance ToJSON PingResponse where + toJSON = toAesonValue + toEncoding = toAesonEncoding + +instance FromJSONPB ParseTreeRequest where + parseJSONPB = withObject "ParseTreeRequest" $ \obj -> do + blobs' <- obj .: "blobs" + pure $ defMessage + & P.blobs .~ blobs' + +instance ToJSONPB ParseTreeRequest where + toJSONPB x = object + [ "blobs" .= (x^.blobs) + ] + toEncodingPB x = pairs + [ "blobs" .= (x^.blobs) + ] instance FromJSON ParseTreeRequest where - parseJSON = withObject "ParseTreeRequest" $ \obj -> do - blobs <- obj .: "blobs" - pure $ defMessage & P.blobs .~ blobs + parseJSON = parseJSONPB instance ToJSON ParseTreeRequest where - toJSON x = object [ "blobs" .= (x^.blobs) ] - toEncoding x = pairs $ "blobs" .= (x^.blobs) + toJSON = toAesonValue + toEncoding = toAesonEncoding -instance FromJSON Blob where - parseJSON = withObject "Blob" $ \obj -> do - content <- obj .: "content" - path <- obj .: "path" - language <- obj .: "language" +instance FromJSONPB ParseTreeSymbolResponse where + parseJSONPB = withObject "ParseTreeSymbolResponse" $ \obj -> do + files' <- obj .: "files" pure $ defMessage - & P.content .~ content - & P.path .~ path - & P.language .~ language + & P.files .~ files' -instance ToJSON Blob where - toJSON x = object - [ "content" .= (x^.content) - , "path" .= (x^.path) - , "language" .= (x^.language) +instance ToJSONPB ParseTreeSymbolResponse where + toJSONPB x = object + [ "files" .= (x^.files) + ] + toEncodingPB x = pairs + [ "files" .= (x^.files) ] - toEncoding x = pairs $ - "content" .= (x^.content) - <> "path" .= (x^.path) - <> "language" .= (x^.language) instance FromJSON ParseTreeSymbolResponse where - parseJSON = withObject "ParseTreeSymbolResponse" $ \obj -> do - files <- obj .: "files" - pure $ defMessage & P.files .~ files + parseJSON = parseJSONPB instance ToJSON ParseTreeSymbolResponse where - toJSON x = object [ "files" .= (x^.files) ] - toEncoding x = pairs $ "files" .= (x^.files) + toJSON = toAesonValue + toEncoding = toAesonEncoding + +instance FromJSONPB ParseTreeGraphResponse where + parseJSONPB = withObject "ParseTreeGraphResponse" $ \obj -> do + files' <- obj .: "files" + pure $ defMessage + & P.files .~ files' + +instance ToJSONPB ParseTreeGraphResponse where + toJSONPB x = object + [ "files" .= (x^.files) + ] + toEncodingPB x = pairs + [ "files" .= (x^.files) + ] instance FromJSON ParseTreeGraphResponse where - parseJSON = withObject "ParseTreeGraphResponse" $ \obj -> do - files <- obj .: "files" - pure $ defMessage & P.files .~ files + parseJSON = parseJSONPB instance ToJSON ParseTreeGraphResponse where - toJSON x = object [ "files" .= (x^.files) ] - toEncoding x = pairs $ "files" .= (x^.files) - -instance FromJSON ParseTreeFileGraph where - parseJSON = withObject "ParseTreeFileGraph" $ \obj -> do - path <- obj .: "path" - language <- obj .: "language" - vertices <- obj .: "vertices" - edges <- obj .: "edges" - errors <- obj .: "errors" + toJSON = toAesonValue + toEncoding = toAesonEncoding + +instance FromJSONPB ParseTreeFileGraph where + parseJSONPB = withObject "ParseTreeFileGraph" $ \obj -> do + path' <- obj .: "path" + language' <- obj .: "language" + vertices' <- obj .: "vertices" + edges' <- obj .: "edges" + errors' <- obj .: "errors" pure $ defMessage - & P.path .~ path - & P.language .~ language - & P.vertices .~ vertices - & P.edges .~ edges - & P.errors .~ errors - -instance ToJSON ParseTreeFileGraph where - toJSON x = object + & P.path .~ path' + & P.language .~ language' + & P.vertices .~ vertices' + & P.edges .~ edges' + & P.errors .~ errors' + +instance ToJSONPB ParseTreeFileGraph where + toJSONPB x = object + [ "path" .= (x^.path) + , "language" .= (x^.language) + , "vertices" .= (x^.vertices) + , "edges" .= (x^.edges) + , "errors" .= (x^.errors) + ] + toEncodingPB x = pairs [ "path" .= (x^.path) , "language" .= (x^.language) , "vertices" .= (x^.vertices) , "edges" .= (x^.edges) , "errors" .= (x^.errors) ] - toEncoding x = pairs $ - "path" .= (x^.path) - <> "language" .= (x^.language) - <> "vertices" .= (x^.vertices) - <> "edges" .= (x^.edges) - <> "errors" .= (x^.errors) -instance FromJSON TermEdge where - parseJSON = withObject "TermEdge" $ \obj -> do - source <- obj .: "source" - target <- obj .: "target" - pure $ defMessage & P.source .~ source & P.target .~ target +instance FromJSON ParseTreeFileGraph where + parseJSON = parseJSONPB -instance ToJSON TermEdge where - toJSON x = object [ "source" .= (x^.source), "target" .= (x^.target) ] - toEncoding x = pairs $ "source" .= (x^.source) <> "target" .= (x^.target) +instance ToJSON ParseTreeFileGraph where + toJSON = toAesonValue + toEncoding = toAesonEncoding -instance FromJSON TermVertex where - parseJSON = withObject "TermVertex" $ \obj -> do - vertexId <- obj .: "vertexId" - term <- obj .: "term" - span <- obj .: "span" +instance FromJSONPB TermEdge where + parseJSONPB = withObject "TermEdge" $ \obj -> do + source' <- obj .: "source" + target' <- obj .: "target" pure $ defMessage - & P.vertexId .~ vertexId - & P.term .~ term - & P.span .~ span + & P.source .~ source' + & P.target .~ target' -instance ToJSON TermVertex where - toJSON x = object - [ "vertexId" .= (x^.vertexId) - , "term" .= (x^.term) - , "span" .= (x^.span) +instance ToJSONPB TermEdge where + toJSONPB x = object + [ "source" .= (x^.source) + , "target" .= (x^.target) ] - toEncoding x = pairs $ - "vertexId" .= (x^.vertexId) - <> "term" .= (x^.term) - <> "span" .= (x^.span) - -instance FromJSON File where - parseJSON = withObject "File" $ \obj -> do - path <- obj .: "path" - language <- obj .: "language" - symbols <- obj .: "symbols" - errors <- obj .: "errors" - blobOid <- obj .: "blobOid" - pure $ defMessage - & P.path .~ path - & P.language .~ language - & P.symbols .~ symbols - & P.errors .~ errors - & P.blobOid .~ blobOid - -instance ToJSON File where - toJSON x = object - [ "path" .= (x^.path) - , "language" .= (x^.language) - , "symbols" .= (x^.symbols) - , "errors" .= (x^.errors) - , "blobOid" .= (x^.blobOid) + toEncodingPB x = pairs + [ "source" .= (x^.source) + , "target" .= (x^.target) ] - toEncoding x = pairs $ - "path" .= (x^.path) - <> "language" .= (x^.language) - <> "symbols" .= (x^.symbols) - <> "errors" .= (x^.errors) - <> "blobOid" .= (x^.blobOid) -instance FromJSON Symbol where - parseJSON = withObject "Symbol" $ \obj -> do - symbol <- obj .: "symbol" - kind <- obj .: "kind" - line <- obj .: "line" - span <- obj .: "span" - docs <- obj .: "docs" +instance FromJSON TermEdge where + parseJSON = parseJSONPB + +instance ToJSON TermEdge where + toJSON = toAesonValue + toEncoding = toAesonEncoding + +instance FromJSONPB TermVertex where + parseJSONPB = withObject "TermVertex" $ \obj -> do + vertexId' <- obj .: "vertexId" + term' <- obj .: "term" + span' <- obj A..:? "span" pure $ defMessage - & P.symbol .~ symbol - & P.kind .~ kind - & P.line .~ line - & P.span .~ span - & P.docs .~ docs + & P.vertexId .~ vertexId' + & P.term .~ term' + & P.maybe'span .~ span' -instance ToJSON Symbol where - toJSON x = object - [ "symbol" .= (x^.symbol) - , "kind" .= (x^.kind) - , "line" .= (x^.line) - , "span" .= (x^.span) - , "docs" .= (x^.docs) +instance ToJSONPB TermVertex where + toJSONPB x = object + [ "vertexId" .= (x^.vertexId) + , "term" .= (x^.term) + , "span" .= (x^.maybe'span) + ] + toEncodingPB x = pairs + [ "vertexId" .= (x^.vertexId) + , "term" .= (x^.term) + , "span" .= (x^.maybe'span) ] - toEncoding x = pairs $ - "symbol" .= (x^.symbol) - <> "kind" .= (x^.kind) - <> "line" .= (x^.line) - <> "span" .= (x^.span) - <> "docs" .= (x^.docs) - -instance FromJSON Span where - parseJSON = withObject "Span" $ \obj -> do - start <- obj .: "start" - end <- obj .: "end" - pure $ defMessage & P.start .~ start & P.end .~ end - -instance ToJSON Span where - toJSON x = object [ "start" .= (x^.start) , "end" .= (x^.end) ] - toEncoding x = pairs $ "start" .= (x^.start) <> "end" .= (x^.end) -instance FromJSON Position where - parseJSON = withObject "Position" $ \obj -> do - line <- obj .: "line" - column <- obj .: "column" - pure $ defMessage & P.line .~ line & P.column .~ column +instance FromJSON TermVertex where + parseJSON = parseJSONPB -instance ToJSON Position where - toJSON x = object [ "line" .= (x^.line) , "column" .= (x^.column) ] - toEncoding x = pairs $ "line" .= (x^.line) <> "column" .= (x^.column) +instance ToJSON TermVertex where + toJSON = toAesonValue + toEncoding = toAesonEncoding -instance FromJSON Docstring where - parseJSON = withObject "Docstring" $ \obj -> do - docstring <- obj .: "docstring" - pure $ defMessage & P.docstring .~ docstring +instance FromJSONPB ParseError where + parseJSONPB = withObject "ParseError" $ \obj -> do + error' <- obj .: "error" + pure $ defMessage + & P.error .~ error' -instance ToJSON Docstring where - toJSON x = object [ "docstring" .= (x^.docstring) ] - toEncoding x = pairs $ "docstring" .= (x^.docstring) +instance ToJSONPB ParseError where + toJSONPB x = object + [ "error" .= (x^.error) + ] + toEncodingPB x = pairs + [ "error" .= (x^.error) + ] instance FromJSON ParseError where - parseJSON = withObject "ParseError" $ \obj -> do - error <- obj .: "error" - pure $ defMessage & P.error .~ error + parseJSON = parseJSONPB instance ToJSON ParseError where - toJSON x = object [ "error" .= (x^.error) ] - toEncoding x = pairs $ "error" .= (x^.error) + toJSON = toAesonValue + toEncoding = toAesonEncoding + +instance FromJSONPB DiffTreeRequest where + parseJSONPB = withObject "DiffTreeRequest" $ \obj -> do + blobs' <- obj .: "blobs" + pure $ defMessage + & P.blobs .~ blobs' + +instance ToJSONPB DiffTreeRequest where + toJSONPB x = object + [ "blobs" .= (x^.blobs) + ] + toEncodingPB x = pairs + [ "blobs" .= (x^.blobs) + ] instance FromJSON DiffTreeRequest where - parseJSON = withObject "DiffTreeRequest" $ \obj -> do - blobs <- obj .: "blobs" - pure $ defMessage & P.blobs .~ blobs + parseJSON = parseJSONPB instance ToJSON DiffTreeRequest where - toJSON x = object [ "blobs" .= (x^.blobs) ] - toEncoding x = pairs $ "blobs" .= (x^.blobs) + toJSON = toAesonValue + toEncoding = toAesonEncoding -instance FromJSON BlobPair where - parseJSON = withObject "BlobPair" $ \obj -> do - before <- obj .: "before" - after <- obj .: "after" - pure $ defMessage & P.before .~ before & P.after .~ after +instance FromJSONPB DiffTreeTOCResponse where + parseJSONPB = withObject "DiffTreeTOCResponse" $ \obj -> do + files' <- obj .: "files" + pure $ defMessage + & P.files .~ files' -instance ToJSON BlobPair where - toJSON x = object [ "before" .= (x^.before), "after" .= (x^.after) ] - toEncoding x = pairs $ "before" .= (x^.before) <> "after" .= (x^.after) +instance ToJSONPB DiffTreeTOCResponse where + toJSONPB x = object + [ "files" .= (x^.files) + ] + toEncodingPB x = pairs + [ "files" .= (x^.files) + ] instance FromJSON DiffTreeTOCResponse where - parseJSON = withObject "DiffTreeTOCResponse" $ \obj -> do - files <- obj .: "files" - pure $ defMessage & P.files .~ files + parseJSON = parseJSONPB instance ToJSON DiffTreeTOCResponse where - toJSON x = object [ "files" .= (x^.files) ] - toEncoding x = pairs $ "files" .= (x^.files) - -instance FromJSON TOCSummaryFile where - parseJSON = withObject "TOCSummaryFile" $ \obj -> do - path <- obj .: "path" - language <- obj .: "language" - changes <- obj .: "changes" - errors <- obj .: "errors" + toJSON = toAesonValue + toEncoding = toAesonEncoding + +instance FromJSONPB TOCSummaryFile where + parseJSONPB = withObject "TOCSummaryFile" $ \obj -> do + path' <- obj .: "path" + language' <- obj .: "language" + changes' <- obj .: "changes" + errors' <- obj .: "errors" pure $ defMessage - & P.path .~ path - & P.language .~ language - & P.changes .~ changes - & P.errors .~ errors + & P.path .~ path' + & P.language .~ language' + & P.changes .~ changes' + & P.errors .~ errors' -instance ToJSON TOCSummaryFile where - toJSON x = object +instance ToJSONPB TOCSummaryFile where + toJSONPB x = object + [ "path" .= (x^.path) + , "language" .= (x^.language) + , "changes" .= (x^.changes) + , "errors" .= (x^.errors) + ] + toEncodingPB x = pairs [ "path" .= (x^.path) , "language" .= (x^.language) , "changes" .= (x^.changes) , "errors" .= (x^.errors) ] - toEncoding x = pairs $ - "path" .= (x^.path) - <> "language" .= (x^.language) - <> "changes" .= (x^.changes) - <> "errors" .= (x^.errors) -instance FromJSON TOCSummaryChange where - parseJSON = withObject "TOCSummaryChange" $ \obj -> do - category <- obj .: "category" - term <- obj .: "term" - span <- obj .: "span" - changeType <- obj .: "changeType" +instance FromJSON TOCSummaryFile where + parseJSON = parseJSONPB + +instance ToJSON TOCSummaryFile where + toJSON = toAesonValue + toEncoding = toAesonEncoding + +instance FromJSONPB TOCSummaryChange where + parseJSONPB = withObject "TOCSummaryChange" $ \obj -> do + category' <- obj .: "category" + term' <- obj .: "term" + span' <- obj A..:? "span" + changeType' <- obj .: "changeType" pure $ defMessage - & P.category .~ category - & P.term .~ term - & P.span .~ span - & P.changeType .~ changeType + & P.category .~ category' + & P.term .~ term' + & P.maybe'span .~ span' + & P.changeType .~ changeType' -instance ToJSON TOCSummaryChange where - toJSON x = object +instance ToJSONPB TOCSummaryChange where + toJSONPB x = object [ "category" .= (x^.category) , "term" .= (x^.term) - , "span" .= (x^.span) + , "span" .= (x^.maybe'span) , "changeType" .= (x^.changeType) ] - toEncoding x = pairs $ - "category" .= (x^.category) - <> "term" .= (x^.term) - <> "span" .= (x^.span) - <> "changeType" .= (x^.changeType) + toEncodingPB x = pairs + [ "category" .= (x^.category) + , "term" .= (x^.term) + , "span" .= (x^.maybe'span) + , "changeType" .= (x^.changeType) + ] + +instance FromJSON TOCSummaryChange where + parseJSON = parseJSONPB + +instance ToJSON TOCSummaryChange where + toJSON = toAesonValue + toEncoding = toAesonEncoding + +instance FromJSONPB TOCSummaryError where + parseJSONPB = withObject "TOCSummaryError" $ \obj -> do + error' <- obj .: "error" + span' <- obj A..:? "span" + pure $ defMessage + & P.error .~ error' + & P.maybe'span .~ span' + +instance ToJSONPB TOCSummaryError where + toJSONPB x = object + [ "error" .= (x^.error) + , "span" .= (x^.maybe'span) + ] + toEncodingPB x = pairs + [ "error" .= (x^.error) + , "span" .= (x^.maybe'span) + ] instance FromJSON TOCSummaryError where - parseJSON = withObject "TOCSummaryError" $ \obj -> do - error <- obj .: "error" - span <- obj .: "span" - pure $ defMessage & P.error .~ error & P.span .~ span + parseJSON = parseJSONPB instance ToJSON TOCSummaryError where - toJSON x = object [ "error" .= (x^.error), "span" .= (x^.span) ] - toEncoding x = pairs $ "error" .= (x^.error) <> "span" .= (x^.span) + toJSON = toAesonValue + toEncoding = toAesonEncoding -instance FromJSON ChangeType where - parseJSON (A.String "NONE") = pure NONE - parseJSON (A.String "ADDED") = pure ADDED - parseJSON (A.String "REMOVED") = pure REMOVED - parseJSON (A.String "MODIFIED") = pure MODIFIED - parseJSON _ = fail "unexpected ChangeType" +instance FromJSONPB DiffTreeGraphResponse where + parseJSONPB = withObject "DiffTreeGraphResponse" $ \obj -> do + files' <- obj .: "files" + pure $ defMessage + & P.files .~ files' -instance ToJSON ChangeType where - toJSON x = A.String . T.toUpper . T.pack $ show x - toEncoding x = E.text . T.toUpper . T.pack $ show x +instance ToJSONPB DiffTreeGraphResponse where + toJSONPB x = object + [ "files" .= (x^.files) + ] + toEncodingPB x = pairs + [ "files" .= (x^.files) + ] instance FromJSON DiffTreeGraphResponse where - parseJSON = withObject "DiffTreeGraphResponse" $ \obj -> do - files <- obj .: "files" - pure $ defMessage & P.files .~ files + parseJSON = parseJSONPB instance ToJSON DiffTreeGraphResponse where - toJSON x = object [ "files" .= (x^.files) ] - toEncoding x = pairs $ "files" .= (x^.files) - -instance FromJSON DiffTreeFileGraph where - parseJSON = withObject "DiffTreeFileGraph" $ \obj -> do - path <- obj .: "path" - language <- obj .: "language" - vertices <- obj .: "vertices" - edges <- obj .: "edges" - errors <- obj .: "errors" + toJSON = toAesonValue + toEncoding = toAesonEncoding + +instance FromJSONPB DiffTreeFileGraph where + parseJSONPB = withObject "DiffTreeFileGraph" $ \obj -> do + path' <- obj .: "path" + language' <- obj .: "language" + vertices' <- obj .: "vertices" + edges' <- obj .: "edges" + errors' <- obj .: "errors" pure $ defMessage - & P.path .~ path - & P.language .~ language - & P.vertices .~ vertices - & P.edges .~ edges - & P.errors .~ errors - -instance ToJSON DiffTreeFileGraph where - toJSON x = object + & P.path .~ path' + & P.language .~ language' + & P.vertices .~ vertices' + & P.edges .~ edges' + & P.errors .~ errors' + +instance ToJSONPB DiffTreeFileGraph where + toJSONPB x = object + [ "path" .= (x^.path) + , "language" .= (x^.language) + , "vertices" .= (x^.vertices) + , "edges" .= (x^.edges) + , "errors" .= (x^.errors) + ] + toEncodingPB x = pairs [ "path" .= (x^.path) , "language" .= (x^.language) , "vertices" .= (x^.vertices) , "edges" .= (x^.edges) , "errors" .= (x^.errors) ] - toEncoding x = pairs $ - "path" .= (x^.path) - <> "language" .= (x^.language) - <> "vertices" .= (x^.vertices) - <> "edges" .= (x^.edges) - <> "errors" .= (x^.errors) -instance FromJSON DiffTreeEdge where - parseJSON = withObject "DiffTreeEdge" $ \obj -> do - source <- obj .: "source" - target <- obj .: "target" - pure $ defMessage & P.source .~ source & P.target .~ target +instance FromJSON DiffTreeFileGraph where + parseJSON = parseJSONPB -instance ToJSON DiffTreeEdge where - toJSON x = object [ "source" .= (x^.source), "target" .= (x^.target) ] - toEncoding x = pairs $ "source" .= (x^.source) <> "target" .= (x^.target) +instance ToJSON DiffTreeFileGraph where + toJSON = toAesonValue + toEncoding = toAesonEncoding -instance FromJSON DiffTreeVertex where - parseJSON = withObject "DiffTreeVertex" $ \obj -> do - diffVertexId <- obj .: "diffVertexId" - diffTerm <- obj .: "diffTerm" +instance FromJSONPB DiffTreeEdge where + parseJSONPB = withObject "DiffTreeEdge" $ \obj -> do + source' <- obj .: "source" + target' <- obj .: "target" pure $ defMessage - & P.diffVertexId .~ diffVertexId - & P.maybe'diffTerm .~ diffTerm + & P.source .~ source' + & P.target .~ target' -instance ToJSON DiffTreeVertex where - toJSON x = object - [ "diffVertexId" .= (x^.diffVertexId) - , "diffTerm" .= (x^.maybe'diffTerm) +instance ToJSONPB DiffTreeEdge where + toJSONPB x = object + [ "source" .= (x^.source) + , "target" .= (x^.target) + ] + toEncodingPB x = pairs + [ "source" .= (x^.source) + , "target" .= (x^.target) ] - toEncoding x = pairs $ - "diffVertexId" .= (x^.diffVertexId) - <> "diffTerm" .= (x^.maybe'diffTerm) -instance FromJSON DiffTreeVertex'DiffTerm where - parseJSON = withObject "DiffTreeVertexDiffTerm" $ \obj -> msum +instance FromJSON DiffTreeEdge where + parseJSON = parseJSONPB + +instance ToJSON DiffTreeEdge where + toJSON = toAesonValue + toEncoding = toAesonEncoding + +instance FromJSONPB DiffTreeVertex'DiffTerm where + parseJSONPB = A.withObject "DiffTreeVertex'DiffTerm" $ \obj -> mconcat [ DiffTreeVertex'Deleted <$> parseField obj "deleted" , DiffTreeVertex'Inserted <$> parseField obj "inserted" @@ -425,78 +470,373 @@ instance FromJSON DiffTreeVertex'DiffTerm where , DiffTreeVertex'Merged <$> parseField obj "merged" ] +instance ToJSONPB DiffTreeVertex'DiffTerm where + toJSONPB (DiffTreeVertex'Deleted x) = object [ "deleted" .= x ] + toJSONPB (DiffTreeVertex'Inserted x) = object [ "inserted" .= x ] + toJSONPB (DiffTreeVertex'Replaced x) = object [ "replaced" .= x ] + toJSONPB (DiffTreeVertex'Merged x) = object [ "merged" .= x ] + toEncodingPB (DiffTreeVertex'Deleted x) = pairs [ "deleted" .= x ] + toEncodingPB (DiffTreeVertex'Inserted x) = pairs [ "inserted" .= x ] + toEncodingPB (DiffTreeVertex'Replaced x) = pairs [ "replaced" .= x ] + toEncodingPB (DiffTreeVertex'Merged x) = pairs [ "merged" .= x ] + +instance FromJSON DiffTreeVertex'DiffTerm where + parseJSON = parseJSONPB + instance ToJSON DiffTreeVertex'DiffTerm where - toJSON (DiffTreeVertex'Deleted x) = object [ "deleted" .= x ] - toJSON (DiffTreeVertex'Inserted x) = object [ "inserted" .= x ] - toJSON (DiffTreeVertex'Replaced x) = object [ "replaced" .= x ] - toJSON (DiffTreeVertex'Merged x) = object [ "merged" .= x ] - toEncoding (DiffTreeVertex'Deleted x) = pairs $ "deleted" .= x - toEncoding (DiffTreeVertex'Inserted x) = pairs $ "inserted" .= x - toEncoding (DiffTreeVertex'Replaced x) = pairs $ "replaced" .= x - toEncoding (DiffTreeVertex'Merged x) = pairs $ "merged" .= x + toJSON = toAesonValue + toEncoding = toAesonEncoding -instance FromJSON MergedTerm where - parseJSON = withObject "MergedTerm" $ \obj -> do - term <- obj .: "term" - beforeSpan <- obj .: "beforeSpan" - afterSpan <- obj .: "afterSpan" +instance FromJSONPB DiffTreeVertex where + parseJSONPB = withObject "DiffTreeVertex" $ \obj -> do + diffVertexId' <- obj .: "diffVertexId" + diffTerm' <- obj A..:? "diffTerm" pure $ defMessage - & P.term .~ term - & P.beforeSpan .~ beforeSpan - & P.afterSpan .~ afterSpan + & P.diffVertexId .~ diffVertexId' + & P.maybe'diffTerm .~ diffTerm' -instance ToJSON MergedTerm where - toJSON x = object +instance ToJSONPB DiffTreeVertex where + toJSONPB x = object + [ "diffVertexId" .= (x^.diffVertexId) + , "diffTerm" .= (x^.maybe'diffTerm) + ] + toEncodingPB x = pairs + [ "diffVertexId" .= (x^.diffVertexId) + , "diffTerm" .= (x^.maybe'diffTerm) + ] + +instance FromJSON DiffTreeVertex where + parseJSON = parseJSONPB + +instance ToJSON DiffTreeVertex where + toJSON = toAesonValue + toEncoding = toAesonEncoding + +instance FromJSONPB DeletedTerm where + parseJSONPB = withObject "DeletedTerm" $ \obj -> do + term' <- obj .: "term" + span' <- obj A..:? "span" + pure $ defMessage + & P.term .~ term' + & P.maybe'span .~ span' + +instance ToJSONPB DeletedTerm where + toJSONPB x = object + [ "term" .= (x^.term) + , "span" .= (x^.maybe'span) + ] + toEncodingPB x = pairs [ "term" .= (x^.term) - , "beforeSpan" .= (x^.beforeSpan) - , "afterSpan" .= (x^.afterSpan) + , "span" .= (x^.maybe'span) ] - toEncoding x = pairs $ - "term" .= (x^.term) - <> "beforeSpan" .= (x^.beforeSpan) - <> "afterSpan" .= (x^.afterSpan) -instance FromJSON ReplacedTerm where - parseJSON = withObject "ReplacedTerm" $ \obj -> do - beforeTerm <- obj .: "beforeTerm" - beforeSpan <- obj .: "beforeSpan" - afterTerm <- obj .: "afterTerm" - afterSpan <- obj .: "afterSpan" +instance FromJSON DeletedTerm where + parseJSON = parseJSONPB + +instance ToJSON DeletedTerm where + toJSON = toAesonValue + toEncoding = toAesonEncoding + +instance FromJSONPB InsertedTerm where + parseJSONPB = withObject "InsertedTerm" $ \obj -> do + term' <- obj .: "term" + span' <- obj A..:? "span" pure $ defMessage - & P.beforeTerm .~ beforeTerm - & P.beforeSpan .~ beforeSpan - & P.afterTerm .~ afterTerm - & P.afterSpan .~ afterSpan + & P.term .~ term' + & P.maybe'span .~ span' -instance ToJSON ReplacedTerm where - toJSON x = object - [ "beforeTerm" .= (x^.beforeTerm) - , "beforeSpan" .= (x^.beforeSpan) - , "afterTerm" .= (x^.afterTerm) - , "afterSpan" .= (x^.afterSpan) +instance ToJSONPB InsertedTerm where + toJSONPB x = object + [ "term" .= (x^.term) + , "span" .= (x^.maybe'span) + ] + toEncodingPB x = pairs + [ "term" .= (x^.term) + , "span" .= (x^.maybe'span) ] - toEncoding x = pairs $ - "beforeTerm" .= (x^.beforeTerm) - <> "beforeSpan" .= (x^.beforeSpan) - <> "afterTerm" .= (x^.afterTerm) - <> "afterSpan" .= (x^.afterSpan) instance FromJSON InsertedTerm where - parseJSON = withObject "InsertedTerm" $ \obj -> do - term <- obj .: "term" - span <- obj .: "span" - pure $ defMessage & P.term .~ term & P.span .~ span + parseJSON = parseJSONPB instance ToJSON InsertedTerm where - toJSON x = object [ "term" .= (x^.term), "span" .= (x^.span) ] - toEncoding x = pairs $ "term" .= (x^.term) <> "span" .= (x^.span) + toJSON = toAesonValue + toEncoding = toAesonEncoding + +instance FromJSONPB ReplacedTerm where + parseJSONPB = withObject "ReplacedTerm" $ \obj -> do + beforeTerm' <- obj .: "beforeTerm" + beforeSpan' <- obj A..:? "beforeSpan" + afterTerm' <- obj .: "afterTerm" + afterSpan' <- obj A..:? "afterSpan" + pure $ defMessage + & P.beforeTerm .~ beforeTerm' + & P.maybe'beforeSpan .~ beforeSpan' + & P.afterTerm .~ afterTerm' + & P.maybe'afterSpan .~ afterSpan' -instance FromJSON DeletedTerm where - parseJSON = withObject "DeletedTerm" $ \obj -> do - term <- obj .: "term" - span <- obj .: "span" - pure $ defMessage & P.term .~ term & P.span .~ span +instance ToJSONPB ReplacedTerm where + toJSONPB x = object + [ "beforeTerm" .= (x^.beforeTerm) + , "beforeSpan" .= (x^.maybe'beforeSpan) + , "afterTerm" .= (x^.afterTerm) + , "afterSpan" .= (x^.maybe'afterSpan) + ] + toEncodingPB x = pairs + [ "beforeTerm" .= (x^.beforeTerm) + , "beforeSpan" .= (x^.maybe'beforeSpan) + , "afterTerm" .= (x^.afterTerm) + , "afterSpan" .= (x^.maybe'afterSpan) + ] -instance ToJSON DeletedTerm where - toJSON x = object [ "term" .= (x^.term), "span" .= (x^.span) ] - toEncoding x = pairs $ "term" .= (x^.term) <> "span" .= (x^.span) +instance FromJSON ReplacedTerm where + parseJSON = parseJSONPB + +instance ToJSON ReplacedTerm where + toJSON = toAesonValue + toEncoding = toAesonEncoding + +instance FromJSONPB MergedTerm where + parseJSONPB = withObject "MergedTerm" $ \obj -> do + term' <- obj .: "term" + beforeSpan' <- obj A..:? "beforeSpan" + afterSpan' <- obj A..:? "afterSpan" + pure $ defMessage + & P.term .~ term' + & P.maybe'beforeSpan .~ beforeSpan' + & P.maybe'afterSpan .~ afterSpan' + +instance ToJSONPB MergedTerm where + toJSONPB x = object + [ "term" .= (x^.term) + , "beforeSpan" .= (x^.maybe'beforeSpan) + , "afterSpan" .= (x^.maybe'afterSpan) + ] + toEncodingPB x = pairs + [ "term" .= (x^.term) + , "beforeSpan" .= (x^.maybe'beforeSpan) + , "afterSpan" .= (x^.maybe'afterSpan) + ] + +instance FromJSON MergedTerm where + parseJSON = parseJSONPB + +instance ToJSON MergedTerm where + toJSON = toAesonValue + toEncoding = toAesonEncoding + +instance FromJSONPB Blob where + parseJSONPB = withObject "Blob" $ \obj -> do + content' <- obj .: "content" + path' <- obj .: "path" + language' <- obj .: "language" + pure $ defMessage + & P.content .~ content' + & P.path .~ path' + & P.language .~ language' + +instance ToJSONPB Blob where + toJSONPB x = object + [ "content" .= (x^.content) + , "path" .= (x^.path) + , "language" .= (x^.language) + ] + toEncodingPB x = pairs + [ "content" .= (x^.content) + , "path" .= (x^.path) + , "language" .= (x^.language) + ] + +instance FromJSON Blob where + parseJSON = parseJSONPB + +instance ToJSON Blob where + toJSON = toAesonValue + toEncoding = toAesonEncoding + +instance FromJSONPB BlobPair where + parseJSONPB = withObject "BlobPair" $ \obj -> do + before' <- obj A..:? "before" + after' <- obj A..:? "after" + pure $ defMessage + & P.maybe'before .~ before' + & P.maybe'after .~ after' + +instance ToJSONPB BlobPair where + toJSONPB x = object + [ "before" .= (x^.maybe'before) + , "after" .= (x^.maybe'after) + ] + toEncodingPB x = pairs + [ "before" .= (x^.maybe'before) + , "after" .= (x^.maybe'after) + ] + +instance FromJSON BlobPair where + parseJSON = parseJSONPB + +instance ToJSON BlobPair where + toJSON = toAesonValue + toEncoding = toAesonEncoding + +instance FromJSONPB File where + parseJSONPB = withObject "File" $ \obj -> do + path' <- obj .: "path" + language' <- obj .: "language" + symbols' <- obj .: "symbols" + errors' <- obj .: "errors" + blobOid' <- obj .: "blobOid" + pure $ defMessage + & P.path .~ path' + & P.language .~ language' + & P.symbols .~ symbols' + & P.errors .~ errors' + & P.blobOid .~ blobOid' + +instance ToJSONPB File where + toJSONPB x = object + [ "path" .= (x^.path) + , "language" .= (x^.language) + , "symbols" .= (x^.symbols) + , "errors" .= (x^.errors) + , "blobOid" .= (x^.blobOid) + ] + toEncodingPB x = pairs + [ "path" .= (x^.path) + , "language" .= (x^.language) + , "symbols" .= (x^.symbols) + , "errors" .= (x^.errors) + , "blobOid" .= (x^.blobOid) + ] + +instance FromJSON File where + parseJSON = parseJSONPB + +instance ToJSON File where + toJSON = toAesonValue + toEncoding = toAesonEncoding + +instance FromJSONPB Symbol where + parseJSONPB = withObject "Symbol" $ \obj -> do + symbol' <- obj .: "symbol" + kind' <- obj .: "kind" + line' <- obj .: "line" + span' <- obj A..:? "span" + docs' <- obj A..:? "docs" + pure $ defMessage + & P.symbol .~ symbol' + & P.kind .~ kind' + & P.line .~ line' + & P.maybe'span .~ span' + & P.maybe'docs .~ docs' + +instance ToJSONPB Symbol where + toJSONPB x = object + [ "symbol" .= (x^.symbol) + , "kind" .= (x^.kind) + , "line" .= (x^.line) + , "span" .= (x^.maybe'span) + , "docs" .= (x^.maybe'docs) + ] + toEncodingPB x = pairs + [ "symbol" .= (x^.symbol) + , "kind" .= (x^.kind) + , "line" .= (x^.line) + , "span" .= (x^.maybe'span) + , "docs" .= (x^.maybe'docs) + ] + +instance FromJSON Symbol where + parseJSON = parseJSONPB + +instance ToJSON Symbol where + toJSON = toAesonValue + toEncoding = toAesonEncoding + +instance FromJSONPB Docstring where + parseJSONPB = withObject "Docstring" $ \obj -> do + docstring' <- obj .: "docstring" + pure $ defMessage + & P.docstring .~ docstring' + +instance ToJSONPB Docstring where + toJSONPB x = object + [ "docstring" .= (x^.docstring) + ] + toEncodingPB x = pairs + [ "docstring" .= (x^.docstring) + ] + +instance FromJSON Docstring where + parseJSON = parseJSONPB + +instance ToJSON Docstring where + toJSON = toAesonValue + toEncoding = toAesonEncoding + +instance FromJSONPB Position where + parseJSONPB = withObject "Position" $ \obj -> do + line' <- obj .: "line" + column' <- obj .: "column" + pure $ defMessage + & P.line .~ line' + & P.column .~ column' + +instance ToJSONPB Position where + toJSONPB x = object + [ "line" .= (x^.line) + , "column" .= (x^.column) + ] + toEncodingPB x = pairs + [ "line" .= (x^.line) + , "column" .= (x^.column) + ] + +instance FromJSON Position where + parseJSON = parseJSONPB + +instance ToJSON Position where + toJSON = toAesonValue + toEncoding = toAesonEncoding + +instance FromJSONPB Span where + parseJSONPB = withObject "Span" $ \obj -> do + start' <- obj A..:? "start" + end' <- obj A..:? "end" + pure $ defMessage + & P.maybe'start .~ start' + & P.maybe'end .~ end' + +instance ToJSONPB Span where + toJSONPB x = object + [ "start" .= (x^.maybe'start) + , "end" .= (x^.maybe'end) + ] + toEncodingPB x = pairs + [ "start" .= (x^.maybe'start) + , "end" .= (x^.maybe'end) + ] + +instance FromJSON Span where + parseJSON = parseJSONPB + +instance ToJSON Span where + toJSON = toAesonValue + toEncoding = toAesonEncoding + +instance FromJSONPB ChangeType where + parseJSONPB (JSONPB.String "NONE") = pure NONE + parseJSONPB (JSONPB.String "ADDED") = pure ADDED + parseJSONPB (JSONPB.String "REMOVED") = pure REMOVED + parseJSONPB (JSONPB.String "MODIFIED") = pure MODIFIED + parseJSONPB x = typeMismatch "ChangeType" x + +instance ToJSONPB ChangeType where + toJSONPB x _ = A.String . T.toUpper . T.pack $ show x + toEncodingPB x _ = E.text . T.toUpper . T.pack $ show x + +instance FromJSON ChangeType where + parseJSON = parseJSONPB + +instance ToJSON ChangeType where + toJSON = toAesonValue + toEncoding = toAesonEncoding From 3fe174a3b60f7e55cf9ccf9fc91737be7c25102e Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Wed, 2 Oct 2019 13:14:20 -0700 Subject: [PATCH 09/13] Fix up tests --- test/Rendering/TOC/Spec.hs | 6 +++--- test/fixtures/cli/diff-tree.toc.json | 2 +- test/fixtures/cli/parse-tree.symbols.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/Rendering/TOC/Spec.hs b/test/Rendering/TOC/Spec.hs index 1a5ff719a2..72015bd109 100644 --- a/test/Rendering/TOC/Spec.hs +++ b/test/Rendering/TOC/Spec.hs @@ -148,7 +148,7 @@ spec = do it "produces JSON output" $ do blobs <- blobsForPaths (Both (Path.relFile "ruby/toc/methods.A.rb") (Path.relFile "ruby/toc/methods.B.rb")) output <- runTaskOrDie (diffSummaryBuilder Format.JSON [blobs]) - runBuilder output `shouldBe` ("{\"files\":[{\"path\":\"test/fixtures/ruby/toc/methods.A.rb -> test/fixtures/ruby/toc/methods.B.rb\",\"language\":\"Ruby\",\"changes\":[{\"category\":\"Method\",\"term\":\"self.foo\",\"span\":{\"start\":{\"line\":1,\"column\":1},\"end\":{\"line\":2,\"column\":4}},\"changeType\":\"ADDED\"},{\"category\":\"Method\",\"term\":\"bar\",\"span\":{\"start\":{\"line\":4,\"column\":1},\"end\":{\"line\":6,\"column\":4}},\"changeType\":\"MODIFIED\"},{\"category\":\"Method\",\"term\":\"baz\",\"span\":{\"start\":{\"line\":4,\"column\":1},\"end\":{\"line\":5,\"column\":4}},\"changeType\":\"REMOVED\"}]}]}\n" :: ByteString) + runBuilder output `shouldBe` ("{\"files\":[{\"path\":\"test/fixtures/ruby/toc/methods.A.rb -> test/fixtures/ruby/toc/methods.B.rb\",\"language\":\"Ruby\",\"changes\":[{\"category\":\"Method\",\"term\":\"self.foo\",\"span\":{\"start\":{\"line\":1,\"column\":1},\"end\":{\"line\":2,\"column\":4}},\"changeType\":\"ADDED\"},{\"category\":\"Method\",\"term\":\"bar\",\"span\":{\"start\":{\"line\":4,\"column\":1},\"end\":{\"line\":6,\"column\":4}},\"changeType\":\"MODIFIED\"},{\"category\":\"Method\",\"term\":\"baz\",\"span\":{\"start\":{\"line\":4,\"column\":1},\"end\":{\"line\":5,\"column\":4}},\"changeType\":\"REMOVED\"}],\"errors\":[]}]}\n" :: ByteString) it "produces JSON output if there are parse errors" $ do blobs <- blobsForPaths (Both (Path.relFile "ruby/toc/methods.A.rb") (Path.relFile "ruby/toc/methods.X.rb")) @@ -158,12 +158,12 @@ spec = do it "ignores anonymous functions" $ do blobs <- blobsForPaths (Both (Path.relFile "ruby/toc/lambda.A.rb") (Path.relFile "ruby/toc/lambda.B.rb")) output <- runTaskOrDie (diffSummaryBuilder Format.JSON [blobs]) - runBuilder output `shouldBe` ("{\"files\":[{\"path\":\"test/fixtures/ruby/toc/lambda.A.rb -> test/fixtures/ruby/toc/lambda.B.rb\",\"language\":\"Ruby\"}]}\n" :: ByteString) + runBuilder output `shouldBe` ("{\"files\":[{\"path\":\"test/fixtures/ruby/toc/lambda.A.rb -> test/fixtures/ruby/toc/lambda.B.rb\",\"language\":\"Ruby\",\"changes\":[],\"errors\":[]}]}\n" :: ByteString) it "summarizes Markdown headings" $ do blobs <- blobsForPaths (Both (Path.relFile "markdown/toc/headings.A.md") (Path.relFile "markdown/toc/headings.B.md")) output <- runTaskOrDie (diffSummaryBuilder Format.JSON [blobs]) - runBuilder output `shouldBe` ("{\"files\":[{\"path\":\"test/fixtures/markdown/toc/headings.A.md -> test/fixtures/markdown/toc/headings.B.md\",\"language\":\"Markdown\",\"changes\":[{\"category\":\"Heading 1\",\"term\":\"Introduction\",\"span\":{\"start\":{\"line\":1,\"column\":1},\"end\":{\"line\":3,\"column\":16}},\"changeType\":\"REMOVED\"},{\"category\":\"Heading 2\",\"term\":\"Two\",\"span\":{\"start\":{\"line\":5,\"column\":1},\"end\":{\"line\":7,\"column\":4}},\"changeType\":\"MODIFIED\"},{\"category\":\"Heading 3\",\"term\":\"This heading is new\",\"span\":{\"start\":{\"line\":9,\"column\":1},\"end\":{\"line\":11,\"column\":10}},\"changeType\":\"ADDED\"},{\"category\":\"Heading 1\",\"term\":\"Final\",\"span\":{\"start\":{\"line\":13,\"column\":1},\"end\":{\"line\":14,\"column\":4}},\"changeType\":\"ADDED\"}]}]}\n" :: ByteString) + runBuilder output `shouldBe` ("{\"files\":[{\"path\":\"test/fixtures/markdown/toc/headings.A.md -> test/fixtures/markdown/toc/headings.B.md\",\"language\":\"Markdown\",\"changes\":[{\"category\":\"Heading 1\",\"term\":\"Introduction\",\"span\":{\"start\":{\"line\":1,\"column\":1},\"end\":{\"line\":3,\"column\":16}},\"changeType\":\"REMOVED\"},{\"category\":\"Heading 2\",\"term\":\"Two\",\"span\":{\"start\":{\"line\":5,\"column\":1},\"end\":{\"line\":7,\"column\":4}},\"changeType\":\"MODIFIED\"},{\"category\":\"Heading 3\",\"term\":\"This heading is new\",\"span\":{\"start\":{\"line\":9,\"column\":1},\"end\":{\"line\":11,\"column\":10}},\"changeType\":\"ADDED\"},{\"category\":\"Heading 1\",\"term\":\"Final\",\"span\":{\"start\":{\"line\":13,\"column\":1},\"end\":{\"line\":14,\"column\":4}},\"changeType\":\"ADDED\"}],\"errors\":[]}]}\n" :: ByteString) type Diff' = Diff ListableSyntax (Maybe Declaration) (Maybe Declaration) diff --git a/test/fixtures/cli/diff-tree.toc.json b/test/fixtures/cli/diff-tree.toc.json index f0e0a42e42..ed11551a88 100644 --- a/test/fixtures/cli/diff-tree.toc.json +++ b/test/fixtures/cli/diff-tree.toc.json @@ -1 +1 @@ -{"files":[{"path":"test/fixtures/ruby/corpus/method-declaration.A.rb -> test/fixtures/ruby/corpus/method-declaration.B.rb","language":"Ruby","changes":[{"category":"Method","term":"bar","span":{"start":{"line":1,"column":1},"end":{"line":3,"column":4}},"changeType":"MODIFIED"}]}]} +{"files":[{"path":"test/fixtures/ruby/corpus/method-declaration.A.rb -> test/fixtures/ruby/corpus/method-declaration.B.rb","language":"Ruby","changes":[{"category":"Method","term":"bar","span":{"start":{"line":1,"column":1},"end":{"line":3,"column":4}},"changeType":"MODIFIED"}],"errors":[]}]} diff --git a/test/fixtures/cli/parse-tree.symbols.json b/test/fixtures/cli/parse-tree.symbols.json index d605418e75..0b6ad690ca 100644 --- a/test/fixtures/cli/parse-tree.symbols.json +++ b/test/fixtures/cli/parse-tree.symbols.json @@ -1 +1 @@ -{"files":[{"path":"test/fixtures/ruby/corpus/method-declaration.A.rb","language":"Ruby","symbols":[{"symbol":"foo","kind":"Method","line":"def foo","span":{"start":{"line":1,"column":1},"end":{"line":2,"column":4}}}]}]} +{"files":[{"path":"test/fixtures/ruby/corpus/method-declaration.A.rb","language":"Ruby","symbols":[{"symbol":"foo","kind":"Method","line":"def foo","span":{"start":{"line":1,"column":1},"end":{"line":2,"column":4}},"docs":null}],"errors":[],"blobOid":""}]} From 1232cc372a1135253f763f57d5a8d87103950e05 Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Wed, 2 Oct 2019 13:53:16 -0700 Subject: [PATCH 10/13] Don't need to hide readFile --- test/Graphing/Calls/Spec.hs | 2 +- test/Semantic/IO/Spec.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Graphing/Calls/Spec.hs b/test/Graphing/Calls/Spec.hs index 1cf4cee407..210466ba0c 100644 --- a/test/Graphing/Calls/Spec.hs +++ b/test/Graphing/Calls/Spec.hs @@ -3,7 +3,7 @@ module Graphing.Calls.Spec ( spec ) where import Prelude hiding (readFile) -import SpecHelpers hiding (readFile) +import SpecHelpers import Algebra.Graph diff --git a/test/Semantic/IO/Spec.hs b/test/Semantic/IO/Spec.hs index 35ccc66c55..324fcd46b8 100644 --- a/test/Semantic/IO/Spec.hs +++ b/test/Semantic/IO/Spec.hs @@ -15,7 +15,7 @@ import Data.Blob import Data.Handle import qualified Semantic.Git as Git import Shelly (cd, run_, shelly, silently, touchfile, writefile) -import SpecHelpers hiding (readFile) +import SpecHelpers import System.Path (()) import qualified System.Path as Path From 54eb04413606cb2ad31abdcf835f8b89c8a855b5 Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Wed, 2 Oct 2019 14:21:02 -0700 Subject: [PATCH 11/13] Minor cleanup --- semantic.cabal | 4 ++-- src/Rendering/Graph.hs | 1 - src/Semantic/Api/Diffs.hs | 1 - src/Semantic/Api/Terms.hs | 1 - 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/semantic.cabal b/semantic.cabal index 0dd46a1b8d..f521491925 100644 --- a/semantic.cabal +++ b/semantic.cabal @@ -71,8 +71,6 @@ common dependencies , text ^>= 1.2.3.1 , these >= 0.7 && <1 , unix ^>= 2.7.2.2 - , proto-lens == 0.5.1.0 - , proto-lens-runtime == 0.5.0.0 , lingo >= 0.2.0.0 common executable-flags @@ -306,7 +304,9 @@ library , prettyprinter ^>= 1.2.1 , pretty-show ^>= 1.9.5 , profunctors ^>= 5.3 + , proto-lens == 0.5.1.0 , proto-lens-jsonpb + , proto-lens-runtime == 0.5.0.0 , reducers ^>= 3.12.3 , semantic-tags ^>= 0 , semigroupoids ^>= 5.3.2 diff --git a/src/Rendering/Graph.hs b/src/Rendering/Graph.hs index 96d8e82742..4c92153185 100644 --- a/src/Rendering/Graph.hs +++ b/src/Rendering/Graph.hs @@ -111,7 +111,6 @@ instance (ConstructorName syntax, Foldable syntax) => & P.maybe'beforeSpan .~ beforeSpan & P.afterTerm .~ afterName & P.maybe'afterSpan .~ afterSpan) - -- graph <- local (const replace) (overlay <$> diffAlgebra t1 (Deleted (Just (DeletedTerm beforeName beforeSpan))) <*> diffAlgebra t2 (Inserted (Just (InsertedTerm afterName afterSpan)))) graph <- local (const replace) (overlay <$> diffAlgebra t1 (DiffTreeVertex'Deleted (defMessage & P.term .~ beforeName & P.maybe'span .~ beforeSpan)) <*> diffAlgebra t2 (DiffTreeVertex'Inserted (defMessage & P.term .~ afterName & P.maybe'span .~ afterSpan))) pure (parent `connect` replace `overlay` graph) where diff --git a/src/Semantic/Api/Diffs.hs b/src/Semantic/Api/Diffs.hs index 3dc8dd32ca..76851b0970 100644 --- a/src/Semantic/Api/Diffs.hs +++ b/src/Semantic/Api/Diffs.hs @@ -49,7 +49,6 @@ import Serializing.Format hiding (JSON) import qualified Serializing.Format as Format import Source.Loc - data DiffOutputFormat = DiffJSONTree | DiffJSONGraph diff --git a/src/Semantic/Api/Terms.hs b/src/Semantic/Api/Terms.hs index f76e48ac15..45fbb461db 100644 --- a/src/Semantic/Api/Terms.hs +++ b/src/Semantic/Api/Terms.hs @@ -32,7 +32,6 @@ import Rendering.JSON hiding (JSON) import qualified Rendering.JSON import Semantic.Api.Bridge import Semantic.Config --- import Semantic.Proto.SemanticPB hiding (Blob) import Semantic.Task import Serializing.Format hiding (JSON) import qualified Serializing.Format as Format From 32f6e9dfb9a72210325b8660e06f43c6960a209f Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Thu, 3 Oct 2019 08:41:30 -0700 Subject: [PATCH 12/13] ++proto-lens-jsonpb to handle excluding default fields --- Dockerfile | 2 +- cabal.project | 2 +- src/Proto/Semantic_JSON.hs | 18 +++++++++--------- src/Semantic/Api/Symbols.hs | 4 ++-- test/Rendering/TOC/Spec.hs | 6 +++--- test/fixtures/cli/diff-tree.toc.json | 2 +- test/fixtures/cli/parse-tree.symbols.json | 2 +- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index ec5acb1e3a..1672f74b11 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ RUN wget "https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/p RUN go get github.com/golang/protobuf/proto && \ go get github.com/twitchtv/protogen/typemap && \ - GO111MODULE=on go get github.com/tclem/proto-lens-jsonpb/protoc-gen-jsonpb_haskell@master + GO111MODULE=on go get github.com/tclem/proto-lens-jsonpb/protoc-gen-jsonpb_haskell@e4d10b77f57ee25beb759a33e63e2061420d3dc2 COPY --from=haskell /root/.cabal/bin/proto-lens-protoc /usr/local/bin/proto-lens-protoc diff --git a/cabal.project b/cabal.project index e359da64eb..90ae8f4bdc 100644 --- a/cabal.project +++ b/cabal.project @@ -5,4 +5,4 @@ jobs: $ncpus source-repository-package type: git location: https://github.com/tclem/proto-lens-jsonpb - tag: 2b4cd579144ea10c3bd36bd05122c233dc5334d7 + tag: e4d10b77f57ee25beb759a33e63e2061420d3dc2 diff --git a/src/Proto/Semantic_JSON.hs b/src/Proto/Semantic_JSON.hs index 6c2493fe98..dbad1fe80a 100644 --- a/src/Proto/Semantic_JSON.hs +++ b/src/Proto/Semantic_JSON.hs @@ -2,7 +2,7 @@ {-# OPTIONS_GHC -Wno-orphans -Wno-unused-imports -Wno-missing-export-lists #-} module Proto.Semantic_JSON where -import Prelude(($), (.), (<$>), pure, show) +import Prelude(($), (.), (<$>), pure, show, Maybe(..)) import Data.ProtoLens.Runtime.Lens.Family2 ((^.), (.~), (&)) import Data.Monoid (mconcat) @@ -471,14 +471,14 @@ instance FromJSONPB DiffTreeVertex'DiffTerm where ] instance ToJSONPB DiffTreeVertex'DiffTerm where - toJSONPB (DiffTreeVertex'Deleted x) = object [ "deleted" .= x ] - toJSONPB (DiffTreeVertex'Inserted x) = object [ "inserted" .= x ] - toJSONPB (DiffTreeVertex'Replaced x) = object [ "replaced" .= x ] - toJSONPB (DiffTreeVertex'Merged x) = object [ "merged" .= x ] - toEncodingPB (DiffTreeVertex'Deleted x) = pairs [ "deleted" .= x ] - toEncodingPB (DiffTreeVertex'Inserted x) = pairs [ "inserted" .= x ] - toEncodingPB (DiffTreeVertex'Replaced x) = pairs [ "replaced" .= x ] - toEncodingPB (DiffTreeVertex'Merged x) = pairs [ "merged" .= x ] + toJSONPB (DiffTreeVertex'Deleted x) = object [ "deleted" .= Just x ] + toJSONPB (DiffTreeVertex'Inserted x) = object [ "inserted" .= Just x ] + toJSONPB (DiffTreeVertex'Replaced x) = object [ "replaced" .= Just x ] + toJSONPB (DiffTreeVertex'Merged x) = object [ "merged" .= Just x ] + toEncodingPB (DiffTreeVertex'Deleted x) = pairs [ "deleted" .= Just x ] + toEncodingPB (DiffTreeVertex'Inserted x) = pairs [ "inserted" .= Just x ] + toEncodingPB (DiffTreeVertex'Replaced x) = pairs [ "replaced" .= Just x ] + toEncodingPB (DiffTreeVertex'Merged x) = pairs [ "merged" .= Just x ] instance FromJSON DiffTreeVertex'DiffTerm where parseJSON = parseJSONPB diff --git a/src/Semantic/Api/Symbols.hs b/src/Semantic/Api/Symbols.hs index d25cc6258e..c50dbfe12d 100644 --- a/src/Semantic/Api/Symbols.hs +++ b/src/Semantic/Api/Symbols.hs @@ -99,8 +99,8 @@ parseSymbols blobs = do & P.maybe'span .~ converting #? span & P.maybe'docs .~ fmap (flip (set P.docstring) defMessage) docs - symbolsToSummarize :: [Text] - symbolsToSummarize = ["Function", "Method", "Class", "Module", "Call", "Send"] +symbolsToSummarize :: [Text] +symbolsToSummarize = ["Function", "Method", "Class", "Module", "Call", "Send"] data ALaCarteTerm syntax ann = ALaCarteTerm Language [Text] (Term syntax ann) diff --git a/test/Rendering/TOC/Spec.hs b/test/Rendering/TOC/Spec.hs index d25c234f7e..9337e7ba4d 100644 --- a/test/Rendering/TOC/Spec.hs +++ b/test/Rendering/TOC/Spec.hs @@ -150,7 +150,7 @@ spec = do it "produces JSON output" $ do blobs <- blobsForPaths (Both (Path.relFile "ruby/toc/methods.A.rb") (Path.relFile "ruby/toc/methods.B.rb")) output <- runTaskOrDie (diffSummaryBuilder Format.JSON [blobs]) - runBuilder output `shouldBe` ("{\"files\":[{\"path\":\"test/fixtures/ruby/toc/methods.A.rb -> test/fixtures/ruby/toc/methods.B.rb\",\"language\":\"Ruby\",\"changes\":[{\"category\":\"Method\",\"term\":\"self.foo\",\"span\":{\"start\":{\"line\":1,\"column\":1},\"end\":{\"line\":2,\"column\":4}},\"changeType\":\"ADDED\"},{\"category\":\"Method\",\"term\":\"bar\",\"span\":{\"start\":{\"line\":4,\"column\":1},\"end\":{\"line\":6,\"column\":4}},\"changeType\":\"MODIFIED\"},{\"category\":\"Method\",\"term\":\"baz\",\"span\":{\"start\":{\"line\":4,\"column\":1},\"end\":{\"line\":5,\"column\":4}},\"changeType\":\"REMOVED\"}],\"errors\":[]}]}\n" :: ByteString) + runBuilder output `shouldBe` ("{\"files\":[{\"path\":\"test/fixtures/ruby/toc/methods.A.rb -> test/fixtures/ruby/toc/methods.B.rb\",\"language\":\"Ruby\",\"changes\":[{\"category\":\"Method\",\"term\":\"self.foo\",\"span\":{\"start\":{\"line\":1,\"column\":1},\"end\":{\"line\":2,\"column\":4}},\"changeType\":\"ADDED\"},{\"category\":\"Method\",\"term\":\"bar\",\"span\":{\"start\":{\"line\":4,\"column\":1},\"end\":{\"line\":6,\"column\":4}},\"changeType\":\"MODIFIED\"},{\"category\":\"Method\",\"term\":\"baz\",\"span\":{\"start\":{\"line\":4,\"column\":1},\"end\":{\"line\":5,\"column\":4}},\"changeType\":\"REMOVED\"}]}]}\n" :: ByteString) it "produces JSON output if there are parse errors" $ do blobs <- blobsForPaths (Both (Path.relFile "ruby/toc/methods.A.rb") (Path.relFile "ruby/toc/methods.X.rb")) @@ -160,12 +160,12 @@ spec = do it "ignores anonymous functions" $ do blobs <- blobsForPaths (Both (Path.relFile "ruby/toc/lambda.A.rb") (Path.relFile "ruby/toc/lambda.B.rb")) output <- runTaskOrDie (diffSummaryBuilder Format.JSON [blobs]) - runBuilder output `shouldBe` ("{\"files\":[{\"path\":\"test/fixtures/ruby/toc/lambda.A.rb -> test/fixtures/ruby/toc/lambda.B.rb\",\"language\":\"Ruby\",\"changes\":[],\"errors\":[]}]}\n" :: ByteString) + runBuilder output `shouldBe` ("{\"files\":[{\"path\":\"test/fixtures/ruby/toc/lambda.A.rb -> test/fixtures/ruby/toc/lambda.B.rb\",\"language\":\"Ruby\"}]}\n" :: ByteString) it "summarizes Markdown headings" $ do blobs <- blobsForPaths (Both (Path.relFile "markdown/toc/headings.A.md") (Path.relFile "markdown/toc/headings.B.md")) output <- runTaskOrDie (diffSummaryBuilder Format.JSON [blobs]) - runBuilder output `shouldBe` ("{\"files\":[{\"path\":\"test/fixtures/markdown/toc/headings.A.md -> test/fixtures/markdown/toc/headings.B.md\",\"language\":\"Markdown\",\"changes\":[{\"category\":\"Heading 1\",\"term\":\"Introduction\",\"span\":{\"start\":{\"line\":1,\"column\":1},\"end\":{\"line\":3,\"column\":16}},\"changeType\":\"REMOVED\"},{\"category\":\"Heading 2\",\"term\":\"Two\",\"span\":{\"start\":{\"line\":5,\"column\":1},\"end\":{\"line\":7,\"column\":4}},\"changeType\":\"MODIFIED\"},{\"category\":\"Heading 3\",\"term\":\"This heading is new\",\"span\":{\"start\":{\"line\":9,\"column\":1},\"end\":{\"line\":11,\"column\":10}},\"changeType\":\"ADDED\"},{\"category\":\"Heading 1\",\"term\":\"Final\",\"span\":{\"start\":{\"line\":13,\"column\":1},\"end\":{\"line\":14,\"column\":4}},\"changeType\":\"ADDED\"}],\"errors\":[]}]}\n" :: ByteString) + runBuilder output `shouldBe` ("{\"files\":[{\"path\":\"test/fixtures/markdown/toc/headings.A.md -> test/fixtures/markdown/toc/headings.B.md\",\"language\":\"Markdown\",\"changes\":[{\"category\":\"Heading 1\",\"term\":\"Introduction\",\"span\":{\"start\":{\"line\":1,\"column\":1},\"end\":{\"line\":3,\"column\":16}},\"changeType\":\"REMOVED\"},{\"category\":\"Heading 2\",\"term\":\"Two\",\"span\":{\"start\":{\"line\":5,\"column\":1},\"end\":{\"line\":7,\"column\":4}},\"changeType\":\"MODIFIED\"},{\"category\":\"Heading 3\",\"term\":\"This heading is new\",\"span\":{\"start\":{\"line\":9,\"column\":1},\"end\":{\"line\":11,\"column\":10}},\"changeType\":\"ADDED\"},{\"category\":\"Heading 1\",\"term\":\"Final\",\"span\":{\"start\":{\"line\":13,\"column\":1},\"end\":{\"line\":14,\"column\":4}},\"changeType\":\"ADDED\"}]}]}\n" :: ByteString) type Diff' = Diff ListableSyntax (Maybe Declaration) (Maybe Declaration) diff --git a/test/fixtures/cli/diff-tree.toc.json b/test/fixtures/cli/diff-tree.toc.json index ed11551a88..f0e0a42e42 100644 --- a/test/fixtures/cli/diff-tree.toc.json +++ b/test/fixtures/cli/diff-tree.toc.json @@ -1 +1 @@ -{"files":[{"path":"test/fixtures/ruby/corpus/method-declaration.A.rb -> test/fixtures/ruby/corpus/method-declaration.B.rb","language":"Ruby","changes":[{"category":"Method","term":"bar","span":{"start":{"line":1,"column":1},"end":{"line":3,"column":4}},"changeType":"MODIFIED"}],"errors":[]}]} +{"files":[{"path":"test/fixtures/ruby/corpus/method-declaration.A.rb -> test/fixtures/ruby/corpus/method-declaration.B.rb","language":"Ruby","changes":[{"category":"Method","term":"bar","span":{"start":{"line":1,"column":1},"end":{"line":3,"column":4}},"changeType":"MODIFIED"}]}]} diff --git a/test/fixtures/cli/parse-tree.symbols.json b/test/fixtures/cli/parse-tree.symbols.json index 0b6ad690ca..d605418e75 100644 --- a/test/fixtures/cli/parse-tree.symbols.json +++ b/test/fixtures/cli/parse-tree.symbols.json @@ -1 +1 @@ -{"files":[{"path":"test/fixtures/ruby/corpus/method-declaration.A.rb","language":"Ruby","symbols":[{"symbol":"foo","kind":"Method","line":"def foo","span":{"start":{"line":1,"column":1},"end":{"line":2,"column":4}},"docs":null}],"errors":[],"blobOid":""}]} +{"files":[{"path":"test/fixtures/ruby/corpus/method-declaration.A.rb","language":"Ruby","symbols":[{"symbol":"foo","kind":"Method","line":"def foo","span":{"start":{"line":1,"column":1},"end":{"line":2,"column":4}}}]}]} From c53712298792738bfbfbe891028d15e7d09b4975 Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Thu, 3 Oct 2019 09:09:40 -0700 Subject: [PATCH 13/13] Allow up to next major version for proto-lens --- semantic.cabal | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/semantic.cabal b/semantic.cabal index f521491925..ba1e07d2a2 100644 --- a/semantic.cabal +++ b/semantic.cabal @@ -304,9 +304,9 @@ library , prettyprinter ^>= 1.2.1 , pretty-show ^>= 1.9.5 , profunctors ^>= 5.3 - , proto-lens == 0.5.1.0 + , proto-lens ^>= 0.5.1.0 , proto-lens-jsonpb - , proto-lens-runtime == 0.5.0.0 + , proto-lens-runtime ^>= 0.5.0.0 , reducers ^>= 3.12.3 , semantic-tags ^>= 0 , semigroupoids ^>= 5.3.2