diff --git a/src/Semantic/Api/Symbols.hs b/src/Semantic/Api/Symbols.hs index 31b3f6c3e..ef63c7f3e 100644 --- a/src/Semantic/Api/Symbols.hs +++ b/src/Semantic/Api/Symbols.hs @@ -44,7 +44,7 @@ legacyParseSymbols blobs = Legacy.ParseTreeSymbolResponse <$> distributeFoldMap symbolsToSummarize = ["Function", "Method", "Class", "Module"] renderToSymbols :: (IsTaggable f, Applicative m) => Term f Loc -> m [Legacy.File] - renderToSymbols = pure . pure . tagsToFile . runTagging blob symbolsToSummarize + renderToSymbols = pure . pure . tagsToFile . runTagging (blobLanguage blob) blobSource symbolsToSummarize tagsToFile :: [Tag] -> Legacy.File tagsToFile tags = Legacy.File (pack (blobPath blob)) (pack (show (blobLanguage blob))) (fmap tagToSymbol tags) @@ -79,7 +79,7 @@ parseSymbols blobs = do errorFile e = File blobPath' (bridging # blobLanguage') mempty (V.fromList [ParseError (T.pack e)]) blobOid renderToSymbols :: IsTaggable f => Term f Loc -> File - renderToSymbols term = tagsToFile (runTagging blob symbolsToSummarize term) + renderToSymbols term = tagsToFile (runTagging (blobLanguage blob) blobSource symbolsToSummarize term) renderPreciseToSymbols :: Py.Term Loc -> File renderPreciseToSymbols term = tagsToFile (Precise.tags blobSource term) diff --git a/src/Tags/Tagging.hs b/src/Tags/Tagging.hs index 17a9d8046..46a5de3ef 100644 --- a/src/Tags/Tagging.hs +++ b/src/Tags/Tagging.hs @@ -14,7 +14,7 @@ import Data.Text as T hiding (empty) import Streaming import qualified Streaming.Prelude as Streaming -import Data.Blob +import Data.Language import Data.Term import Source.Loc import qualified Source.Source as Source @@ -22,16 +22,17 @@ import Tags.Tag import Tags.Taggable runTagging :: (IsTaggable syntax) - => Blob + => Language + -> Source.Source -> [Text] -> Term syntax Loc -> [Tag] -runTagging blob symbolsToSummarize +runTagging lang source symbolsToSummarize = Eff.run . evalState @[ContextToken] [] . Streaming.toList_ - . contextualizing (blobSource blob) toKind - . tagging (blobLanguage blob) + . contextualizing source toKind + . tagging lang where toKind x = do guard (x `elem` symbolsToSummarize)