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:
parent
d3a462aaf7
commit
dc3774047d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user