mirror of
https://github.com/github/semantic.git
synced 2024-12-21 05:41:54 +03:00
Don’t pass the blob into runTagging.
This commit is contained in:
parent
de5de5f936
commit
937df795a1
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user