diff --git a/src/Semantic/Api/Symbols.hs b/src/Semantic/Api/Symbols.hs index a514d9851..1926e6c63 100644 --- a/src/Semantic/Api/Symbols.hs +++ b/src/Semantic/Api/Symbols.hs @@ -56,8 +56,8 @@ legacyParseSymbols blobs = Legacy.ParseTreeSymbolResponse <$> distributeFoldMap , symbolSpan = converting #? span } -parseSymbolsBuilder :: (Member Distribute sig, ParseEffects sig m, Traversable t) => t Blob -> m Builder -parseSymbolsBuilder blobs = parseSymbols blobs >>= serialize JSON +parseSymbolsBuilder :: (Member Distribute sig, ParseEffects sig m, Traversable t) => Format ParseTreeSymbolResponse -> t Blob -> m Builder +parseSymbolsBuilder format blobs = parseSymbols blobs >>= serialize format parseSymbols :: (Member Distribute sig, ParseEffects sig m, Traversable t) => t Blob -> m ParseTreeSymbolResponse parseSymbols blobs = ParseTreeSymbolResponse . V.fromList . toList <$> distributeFor blobs go diff --git a/src/Semantic/CLI.hs b/src/Semantic/CLI.hs index 52a97b8a0..c2b076b3c 100644 --- a/src/Semantic/CLI.hs +++ b/src/Semantic/CLI.hs @@ -77,7 +77,9 @@ parseCommand = command "parse" (info parseArgumentsParser (progDesc "Generate pa renderer <- flag (parseTermBuilder TermSExpression) (parseTermBuilder TermSExpression) (long "sexpression" <> help "Output s-expression parse trees (default)") <|> flag' (parseTermBuilder TermJSONTree) (long "json" <> help "Output JSON parse trees") <|> flag' (parseTermBuilder TermJSONGraph) (long "json-graph" <> help "Output JSON adjacency list") - <|> flag' parseSymbolsBuilder (long "symbols" <> help "Output JSON symbol list") + <|> flag' (parseSymbolsBuilder JSON) (long "symbols" <> help "Output JSON symbol list") + <|> flag' (parseSymbolsBuilder JSON) (long "json-symbols" <> help "Output JSON symbol list") + <|> flag' (parseSymbolsBuilder Proto) (long "proto-symbols" <> help "Output JSON symbol list") <|> flag' (parseTermBuilder TermDotGraph) (long "dot" <> help "Output DOT graph parse trees") <|> flag' (parseTermBuilder TermShow) (long "show" <> help "Output using the Show instance (debug only, format subject to change without notice)") <|> flag' (parseTermBuilder TermQuiet) (long "quiet" <> help "Don't produce output, but show timing stats")