mirror of
https://github.com/github/semantic.git
synced 2024-11-28 10:15:55 +03:00
Simplify the Call instance using gtags.
This commit is contained in:
parent
2ffb64ad0f
commit
1d84e7826e
@ -86,16 +86,15 @@ instance ToTagsBy 'Custom Py.ClassDefinition where
|
||||
traverse_ tags extraChildren
|
||||
|
||||
instance ToTagsBy 'Custom Py.Call where
|
||||
tags' Py.Call
|
||||
tags' t@Py.Call
|
||||
{ ann = Loc range span
|
||||
, function = Py.IdentifierPrimaryExpression Py.Identifier { bytes = name }
|
||||
, arguments
|
||||
} = do
|
||||
src <- ask @Source
|
||||
let sliced = slice src range
|
||||
Tags.yield (Tag name Call span (Tags.firstLine sliced) Nothing)
|
||||
tags arguments
|
||||
tags' Py.Call { function, arguments } = tags function >> tags arguments
|
||||
gtags t
|
||||
tags' t@Py.Call{} = gtags t
|
||||
|
||||
docComment :: Source -> (Py.CompoundStatement :+: Py.SimpleStatement) Loc -> Maybe Text
|
||||
docComment src (R1 (Py.ExpressionStatementSimpleStatement (Py.ExpressionStatement { extraChildren = L1 (Py.PrimaryExpressionExpression (Py.StringPrimaryExpression Py.String { ann })) :|_ }))) = Just (toText (slice src (byteRange ann)))
|
||||
|
Loading…
Reference in New Issue
Block a user