diff --git a/src/Rendering/Renderer.hs b/src/Rendering/Renderer.hs index 87fc45f20..28c48c8f5 100644 --- a/src/Rendering/Renderer.hs +++ b/src/Rendering/Renderer.hs @@ -12,7 +12,6 @@ module Rendering.Renderer , renderToSymbols , ImportSummary(..) , renderToImports -, renderToTags , renderTreeGraph , Summaries(..) , TOCSummary(..) @@ -21,7 +20,6 @@ module Rendering.Renderer , parseSymbolFields ) where -import Data.Aeson (Value) import Data.ByteString.Builder import Data.Graph import Rendering.Graph as R @@ -52,8 +50,6 @@ data TermRenderer output where JSONTermRenderer :: TermRenderer (JSON "trees" SomeJSON) -- | Render to a 'ByteString' formatted as nested s-expressions. SExpressionTermRenderer :: TermRenderer Builder - -- | Render to a list of tags (deprecated). - TagsTermRenderer :: TermRenderer [Value] -- | Render to a list of symbols. SymbolsTermRenderer :: SymbolFields -> TermRenderer (JSON "files" SomeJSON) -- | Render to a list of modules that represent the import graph. diff --git a/src/Rendering/Symbol.hs b/src/Rendering/Symbol.hs index 97fdcb29f..895387002 100644 --- a/src/Rendering/Symbol.hs +++ b/src/Rendering/Symbol.hs @@ -1,7 +1,6 @@ {-# LANGUAGE RankNTypes, ScopedTypeVariables, TypeFamilies, TypeOperators, UndecidableInstances #-} module Rendering.Symbol ( renderToSymbols -, renderToTags , SymbolFields(..) , defaultSymbolFields , parseSymbolFields @@ -20,18 +19,6 @@ import qualified Data.Text as T 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 - termToC :: (HasField fields (Maybe Declaration), HasField fields Span, Foldable f, Functor f) => FilePath -> Term f (Record fields) -> [Symbol] - termToC path = mapMaybe (symbolSummary defaultTagSymbolFields path "unchanged") . termTableOfContentsBy declaration - - -- | Render a 'Term' to a list of symbols (See 'Symbol'). renderToSymbols :: (HasField fields (Maybe Declaration), HasField fields Span, Foldable f, Functor f) => SymbolFields -> Blob -> Term f (Record fields) -> [Value] renderToSymbols fields Blob{..} term = [toJSON (termToC fields blobPath term)] diff --git a/src/Semantic/CLI.hs b/src/Semantic/CLI.hs index a62521022..77572ffd9 100644 --- a/src/Semantic/CLI.hs +++ b/src/Semantic/CLI.hs @@ -64,7 +64,6 @@ arguments = info (version <*> helper <*> ((,) <$> optionsParser <*> argumentsPar parseArgumentsParser = do renderer <- flag (Parse.runParse SExpressionTermRenderer) (Parse.runParse SExpressionTermRenderer) (long "sexpression" <> help "Output s-expression parse trees (default)") <|> flag' (Parse.runParse JSONTermRenderer) (long "json" <> help "Output JSON parse trees") - <|> flag' (Parse.runParse TagsTermRenderer) (long "tags" <> help "Output JSON tags") <|> flag' (Parse.runParse . SymbolsTermRenderer) (long "symbols" <> help "Output JSON symbol list") <*> (option symbolFieldsReader ( long "fields" <> help "Comma delimited list of specific fields to return (symbols output only)." diff --git a/src/Semantic/Parse.hs b/src/Semantic/Parse.hs index b0d7bb2d7..2523482ec 100644 --- a/src/Semantic/Parse.hs +++ b/src/Semantic/Parse.hs @@ -21,7 +21,6 @@ runParse :: (Member (Distribute WrappedTask) effs, Member Task effs) => TermRend runParse JSONTermRenderer = withParsedBlobs (render . renderJSONTerm) >=> serialize JSON runParse SExpressionTermRenderer = withParsedBlobs (const (serialize (SExpression ByConstructorName))) runParse ShowTermRenderer = withParsedBlobs (const (serialize Show)) -runParse TagsTermRenderer = withParsedBlobs (\ blob -> decorate (declarationAlgebra blob) >=> render (renderToTags blob)) >=> serialize JSON runParse ImportsTermRenderer = withParsedBlobs (\ blob -> decorate (declarationAlgebra blob) >=> decorate (packageDefAlgebra blob) >=> render (renderToImports blob)) >=> serialize JSON runParse (SymbolsTermRenderer fields) = withParsedBlobs (\ blob -> decorate (declarationAlgebra blob) >=> render (renderSymbolTerms . renderToSymbols fields blob)) >=> serialize JSON runParse DOTTermRenderer = withParsedBlobs (const (render renderTreeGraph)) >=> serialize (DOT (termStyle "terms")) diff --git a/test/Semantic/CLI/Spec.hs b/test/Semantic/CLI/Spec.hs index 2a9b1e539..a64a12d29 100644 --- a/test/Semantic/CLI/Spec.hs +++ b/test/Semantic/CLI/Spec.hs @@ -37,7 +37,6 @@ parseFixtures = , (show JSONTermRenderer, runParse JSONTermRenderer, path', prefix "parse-trees.json") , (show JSONTermRenderer, runParse JSONTermRenderer, [], prefix "parse-tree-empty.json") , (show (SymbolsTermRenderer defaultSymbolFields), runParse (SymbolsTermRenderer defaultSymbolFields), path'', prefix "parse-tree.symbols.json") - , (show TagsTermRenderer, runParse TagsTermRenderer, path'', prefix "parse-tree.tags.json") ] where path = [File "test/fixtures/ruby/corpus/and-or.A.rb" Ruby] path' = [File "test/fixtures/ruby/corpus/and-or.A.rb" Ruby, File "test/fixtures/ruby/corpus/and-or.B.rb" Ruby] diff --git a/test/fixtures/cli/parse-tree.tags.json b/test/fixtures/cli/parse-tree.tags.json deleted file mode 100644 index dd1281eaa..000000000 --- a/test/fixtures/cli/parse-tree.tags.json +++ /dev/null @@ -1,13 +0,0 @@ -[ -{ - "span": - { - "start": [1, 1], - "end": [2, 4] - }, - "path": "test/fixtures/ruby/corpus/method-declaration.A.rb", - "kind": "Method", - "symbol": "foo", - "line": "def foo", - "language": "Ruby" -}]