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

Stub in a custom ToTagBy instance for class definitions.

This commit is contained in:
Rob Rix 2019-09-23 17:36:45 -04:00
parent c4daf7bcea
commit 683ab79c06
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -58,6 +58,7 @@ type family ToTagInstance t :: Strategy where
ToTagInstance [_] = 'Custom
ToTagInstance ((_ :+: _) _) = 'Custom
ToTagInstance (Py.FunctionDefinition Loc) = 'Custom
ToTagInstance (Py.ClassDefinition Loc) = 'Custom
ToTagInstance _ = 'Generic
instance ToTagBy 'Custom Loc where
@ -89,6 +90,9 @@ instance ToTagBy 'Custom (Py.FunctionDefinition Loc) where
tag returnType
traverse_ tag extraChildren
instance ToTagBy 'Custom (Py.ClassDefinition Loc) where
tag' Py.ClassDefinition {} = pure ()
yield :: (Carrier sig m, Member (Writer (Endo [Tag])) sig) => Tag -> m ()
yield = tell . Endo . (:)