mirror of
https://github.com/github/semantic.git
synced 2024-12-22 06:11:49 +03:00
Define a ToJSONFields instance for SourceText.
This commit is contained in:
parent
59735e5dac
commit
9944b32d9f
@ -95,6 +95,9 @@ instance ToJSONFields Category where
|
||||
instance ToJSONFields SourceSpan where
|
||||
toJSONFields SourceSpan{..} = [ "start" .= spanStart, "end" .= spanEnd ]
|
||||
|
||||
instance ToJSONFields SourceText where
|
||||
toJSONFields (SourceText t) = [ "sourceText" .= t ]
|
||||
|
||||
instance ToJSONFields a => ToJSONFields (Maybe a) where
|
||||
toJSONFields = maybe [] toJSONFields
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user