1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 06:41:45 +03:00
This commit is contained in:
Timothy Clem 2018-01-17 13:03:23 -08:00
parent 198c31e9f0
commit 02b883e6ff

View File

@ -21,6 +21,10 @@ import Rendering.TOC
-- | Render a 'Term' to a ctags like output (See 'Tag').
--
-- This format is going away. Prefer the new 'renderToSymbols' as it provides a
-- more compact data representation and custom field selection. This exists to
-- back support the staff shipped tag generation in github/github.
renderToTags :: (HasField fields (Maybe Declaration), HasField fields Span, Foldable f, Functor f) => Blob -> Term f (Record fields) -> [Value]
renderToTags Blob{..} = fmap toJSON . termToC blobPath
where
@ -28,6 +32,7 @@ renderToTags Blob{..} = fmap toJSON . termToC blobPath
termToC path = mapMaybe (symbolSummary defaultTagSymbolFields path "unchanged") . termTableOfContentsBy declaration
-- | Render terms to final JSON structure.
renderSymbolTerms :: [Value] -> Map.Map T.Text Value
renderSymbolTerms = Map.singleton "files" . toJSON