mirror of
https://github.com/github/semantic.git
synced 2024-12-21 13:51:44 +03:00
Rename the ErrorSummary fields.
This commit is contained in:
parent
bd7c33d1ae
commit
bad94967a9
@ -39,15 +39,15 @@ data TOCSummary
|
||||
, changeType :: T.Text
|
||||
}
|
||||
| ErrorSummary
|
||||
{ errorText :: T.Text
|
||||
, errorSpan :: Span
|
||||
, errorLanguage :: Language
|
||||
{ message :: T.Text
|
||||
, span :: Span
|
||||
, language :: Language
|
||||
}
|
||||
deriving stock (Eq, Show)
|
||||
|
||||
instance ToJSON TOCSummary where
|
||||
toJSON TOCSummary{..} = object [ "changeType" .= changeType, "category" .= kind, "term" .= ident, "span" .= span ]
|
||||
toJSON ErrorSummary{..} = object [ "error" .= errorText, "span" .= errorSpan, "language" .= errorLanguage ]
|
||||
toJSON ErrorSummary{..} = object [ "error" .= message, "span" .= span, "language" .= language ]
|
||||
|
||||
isValidSummary :: TOCSummary -> Bool
|
||||
isValidSummary ErrorSummary{} = False
|
||||
|
@ -68,4 +68,4 @@ diffSummary blobs = do
|
||||
& 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
|
||||
& P.errors .~ (defMessage & P.error .~ message & P.maybe'span .~ converting #? span) : file^.P.errors
|
||||
|
Loading…
Reference in New Issue
Block a user