From 53f3e5e9cc29eff111fe2b5132005bdb87e0c67a Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Fri, 27 Sep 2019 11:17:41 -0400 Subject: [PATCH] :fire: the context field from Data.Tag.Tag. --- src/Data/Tag.hs | 1 - src/Tags/Tagging.hs | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Data/Tag.hs b/src/Data/Tag.hs index dee47f6c3..ce2aa1462 100644 --- a/src/Data/Tag.hs +++ b/src/Data/Tag.hs @@ -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) diff --git a/src/Tags/Tagging.hs b/src/Tags/Tagging.hs index a0a5e602e..f617566fe 100644 --- a/src/Tags/Tagging.hs +++ b/src/Tags/Tagging.hs @@ -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)