1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 07:25:44 +03:00

Fix assignment double tagging

This commit is contained in:
Timothy Clem 2020-01-10 14:05:30 -08:00
parent 9f6da4eb47
commit 99e9ee08aa

View File

@ -294,14 +294,14 @@ instance ToTagsBy 'Custom Rb.Assignment where
case left of
Prj (Rb.Lhs (Prj (Rb.Variable (Prj Rb.Identifier { text })))) -> modify (text :)
Prj Rb.LeftAssignmentList { extraChildren } -> introduceLhsLocals extraChildren
_ -> tags left
_ -> pure ()
gtags t
where
introduceLhsLocals xs = for_ xs $ \x -> case x of
Prj (Rb.Lhs (Prj (Rb.Variable (Prj Rb.Identifier { text })))) -> modify (text :)
Prj Rb.DestructuredLeftAssignment { extraChildren } -> introduceLhsLocals extraChildren
Prj Rb.RestAssignment { extraChildren = Just (Rb.Lhs (Prj (Rb.Variable (Prj Rb.Identifier { text })))) } -> modify (text :)
_ -> tags x
_ -> pure ()
gtags
:: ( Has (Reader Source) sig m