mirror of
https://github.com/github/semantic.git
synced 2024-12-27 00:44:57 +03:00
🔥 the context field from Data.Tag.Tag.
This commit is contained in:
parent
ed85a4483f
commit
53f3e5e9cc
@ -13,7 +13,6 @@ data Tag = Tag
|
||||
{ name :: Text
|
||||
, kind :: Text
|
||||
, span :: Span
|
||||
, context :: [Text]
|
||||
, line :: Maybe Text
|
||||
, docs :: Maybe Text
|
||||
} deriving (Eq, Show, Generic)
|
||||
|
@ -45,10 +45,10 @@ contextualizing Blob{..} symbolsToSummarize = Streaming.mapMaybeM $ \case
|
||||
Enter x r -> Nothing <$ enterScope (x, r)
|
||||
Exit x r -> Nothing <$ exitScope (x, r)
|
||||
Iden iden span docsLiteralRange -> get @[ContextToken] >>= pure . \case
|
||||
((x, r):("Context", cr):xs) | x `elem` symbolsToSummarize
|
||||
-> Just $ Tag iden x span (fmap fst xs) (firstLine (slice r)) (slice cr)
|
||||
((x, r):xs) | x `elem` symbolsToSummarize
|
||||
-> Just $ Tag iden x span (fmap fst xs) (firstLine (slice r)) (slice docsLiteralRange)
|
||||
((x, r):("Context", cr):_) | x `elem` symbolsToSummarize
|
||||
-> Just $ Tag iden x span (firstLine (slice r)) (slice cr)
|
||||
((x, r):_) | x `elem` symbolsToSummarize
|
||||
-> Just $ Tag iden x span (firstLine (slice r)) (slice docsLiteralRange)
|
||||
_ -> Nothing
|
||||
where
|
||||
slice = fmap (stripEnd . Source.toText . Source.slice blobSource)
|
||||
|
Loading…
Reference in New Issue
Block a user