mirror of
https://github.com/github/semantic.git
synced 2024-12-27 00:44:57 +03:00
slice/firstLine are total.
This commit is contained in:
parent
bbb583de55
commit
65eed49ecc
@ -46,13 +46,13 @@ contextualizing Blob{..} symbolsToSummarize = Streaming.mapMaybeM $ \case
|
||||
Exit x r -> Nothing <$ exitScope (x, r)
|
||||
Iden iden span docsLiteralRange -> get @[ContextToken] >>= pure . \case
|
||||
((x, r):("Context", cr):_) | x `elem` symbolsToSummarize
|
||||
-> Just $ Tag iden x span (firstLine (slice (Just r))) (slice (Just cr))
|
||||
-> Just $ Tag iden x span (Just (firstLine (slice r))) (Just (slice cr))
|
||||
((x, r):_) | x `elem` symbolsToSummarize
|
||||
-> Just $ Tag iden x span (firstLine (slice (Just r))) (slice docsLiteralRange)
|
||||
-> Just $ Tag iden x span (Just (firstLine (slice r))) (slice <$> docsLiteralRange)
|
||||
_ -> Nothing
|
||||
where
|
||||
slice = fmap (stripEnd . Source.toText . Source.slice blobSource)
|
||||
firstLine = fmap (T.take 180 . fst . breakOn "\n")
|
||||
slice = stripEnd . Source.toText . Source.slice blobSource
|
||||
firstLine = T.take 180 . fst . breakOn "\n"
|
||||
|
||||
enterScope, exitScope :: ( Member (State [ContextToken]) sig
|
||||
, Carrier sig m
|
||||
|
Loading…
Reference in New Issue
Block a user