1
1
mirror of https://github.com/github/semantic.git synced 2024-12-19 04:41:47 +03:00

Rename the ErrorSummary fields.

This commit is contained in:
Rob Rix 2019-10-16 22:21:36 -04:00
parent bd7c33d1ae
commit bad94967a9
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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