1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 17:59:10 +03:00

Define an advanced-overlappable Taggable class.

This commit is contained in:
Rob Rix 2019-09-18 12:41:22 -04:00
parent d3a462aaf7
commit dc3774047d
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -10,7 +10,7 @@ identify a new syntax as Taggable, you need to:
constructor name of this syntax.
-}
{-# LANGUAGE ConstraintKinds, MonoLocalBinds, UndecidableInstances #-}
{-# LANGUAGE AllowAmbiguousTypes, ConstraintKinds, KindSignatures, MonoLocalBinds, UndecidableInstances #-}
module Tags.Taggable
( Tagger
, Token(..)
@ -88,6 +88,19 @@ class Taggable constr where
symbolName :: Declarations1 syntax => constr (Term syntax Location) -> Maybe Name
symbolName _ = Nothing
data Strategy = Default | Custom
class TaggableBy (strategy :: Strategy) constr where
docsLiteral' ::
( Foldable syntax
, HasTextElement syntax
)
=> Language -> constr (Term syntax Location) -> Maybe Range
snippet' :: (Foldable syntax) => Location -> constr (Term syntax Location) -> Maybe Range
symbolName' :: Declarations1 syntax => constr (Term syntax Location) -> Maybe Name
type IsTaggable syntax =
( Functor syntax
, Foldable syntax