1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 02:44:36 +03:00

Flesh out the ToTagBy instance for calls.

This commit is contained in:
Rob Rix 2019-09-23 17:51:43 -04:00
parent 61915b8152
commit e816d60260
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -93,6 +93,15 @@ instance ToTagBy 'Custom Py.ClassDefinition where
traverse_ tag extraChildren traverse_ tag extraChildren
instance ToTagBy 'Custom Py.Call where instance ToTagBy 'Custom Py.Call where
tag' Py.Call
{ ann = Loc range span
, function = Py.IdentifierPrimaryExpression Py.Identifier { bytes = name }
, arguments
} = do
src <- ask @Source
let sliced = slice src range
yield (Tag name Call span (Just (firstLine sliced)) Nothing)
tag arguments
tag' Py.Call {} = pure () tag' Py.Call {} = pure ()
yield :: (Carrier sig m, Member (Writer (Endo [Tag])) sig) => Tag -> m () yield :: (Carrier sig m, Member (Writer (Endo [Tag])) sig) => Tag -> m ()