1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 08:25:19 +03:00

Track locals in operator assignment

This commit is contained in:
Timothy Clem 2020-01-10 15:24:26 -08:00
parent aca2106862
commit bc13ecac13

View File

@ -89,6 +89,8 @@ type family ToTagsInstance t :: Strategy where
ToTagsInstance Rb.LambdaParameters = 'Custom
ToTagsInstance Rb.BlockParameters = 'Custom
ToTagsInstance Rb.Assignment = 'Custom
ToTagsInstance Rb.OperatorAssignment = 'Custom
ToTagsInstance _ = 'Generic
@ -337,6 +339,13 @@ instance ToTagsBy 'Custom Rb.Assignment where
Prj Rb.RestAssignment { extraChildren = Just (Rb.Lhs (Prj (Rb.Variable (Prj Rb.Identifier { text })))) } -> modify (text :)
_ -> pure ()
instance ToTagsBy 'Custom Rb.OperatorAssignment where
tags' t@Rb.OperatorAssignment{ left } = do
case left of
Prj (Rb.Lhs (Prj (Rb.Variable (Prj Rb.Identifier { text })))) -> modify (text :)
_ -> pure ()
gtags t
gtags
:: ( Has (Reader Source) sig m
, Has (Writer Tags.Tags) sig m