1
1
mirror of https://github.com/github/semantic.git synced 2024-11-25 11:04:00 +03:00

Tags always have lines.

This commit is contained in:
Rob Rix 2019-09-23 17:52:22 -04:00
parent e816d60260
commit b5cffe8ebe
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7
2 changed files with 4 additions and 4 deletions

View File

@ -10,7 +10,7 @@ data Tag = Tag
{ name :: Text
, kind :: Kind
, span :: Span
, line :: Maybe Text
, line :: Text
, docs :: Maybe Text
}
deriving (Eq, Show)

View File

@ -73,7 +73,7 @@ instance ToTagBy 'Custom Py.FunctionDefinition where
src <- ask @Source
let docs = listToMaybe extraChildren >>= docComment src
sliced = slice src (Range start end)
yield (Tag name Function span (Just (firstLine sliced)) docs)
yield (Tag name Function span (firstLine sliced) docs)
tag parameters
traverse_ tag returnType
traverse_ tag extraChildren
@ -88,7 +88,7 @@ instance ToTagBy 'Custom Py.ClassDefinition where
src <- ask @Source
let docs = listToMaybe extraChildren >>= docComment src
sliced = slice src (Range start end)
yield (Tag name Class span (Just (firstLine sliced)) docs)
yield (Tag name Class span (firstLine sliced) docs)
traverse_ tag superclasses
traverse_ tag extraChildren
@ -100,7 +100,7 @@ instance ToTagBy 'Custom Py.Call where
} = do
src <- ask @Source
let sliced = slice src range
yield (Tag name Call span (Just (firstLine sliced)) Nothing)
yield (Tag name Call span (firstLine sliced) Nothing)
tag arguments
tag' Py.Call {} = pure ()