1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 06:41:45 +03:00

Alignment

This commit is contained in:
Timothy Clem 2018-01-22 11:24:30 -08:00
parent fb5cb974a6
commit c819d50813

View File

@ -78,12 +78,13 @@ data Symbol = Symbol
} deriving (Generic, Eq, Show)
instance ToJSON Symbol where
toJSON Symbol{..} = objectWithoutNulls [ "symbol" .= symbolName
, "path" .= symbolPath
, "language" .= symbolLang
, "kind" .= symbolKind
, "line" .= symbolLine
, "span" .= symbolSpan ]
toJSON Symbol{..} = objectWithoutNulls
[ "symbol" .= symbolName
, "path" .= symbolPath
, "language" .= symbolLang
, "kind" .= symbolKind
, "line" .= symbolLine
, "span" .= symbolSpan ]
where objectWithoutNulls = object . filter (\(_, v) -> v /= Null)
when :: Bool -> a -> Maybe a