Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data TAG_KIND
- data SingTagKind (tk :: TAG_KIND) where
- data Tag (tk :: TAG_KIND) = Tag {
- tagName :: !TagName
- tagKind :: !(TagKind tk)
- tagFilePath :: !FilePath
- tagAddr :: !(TagAddress tk)
- tagDefinition :: !(TagDefinition tk)
- tagFields :: !(TagFields tk)
- type ETag = Tag ETAG
- type CTag = Tag CTAG
- newtype TagName = TagName {
- getTagName :: Text
- newtype ExCommand = ExCommand {
- getExCommand :: Text
- data TagAddress (tk :: TAG_KIND) where
- TagLineCol :: !Int -> !Int -> TagAddress tk
- TagLine :: !Int -> TagAddress CTAG
- TagCommand :: !ExCommand -> TagAddress CTAG
- type CTagAddress = TagAddress CTAG
- type ETagAddress = TagAddress ETAG
- data TagKind (tk :: TAG_KIND) where
- TkTerm :: TagKind CTAG
- TkFunction :: TagKind CTAG
- TkTypeConstructor :: TagKind CTAG
- TkDataConstructor :: TagKind CTAG
- TkGADTConstructor :: TagKind CTAG
- TkRecordField :: TagKind CTAG
- TkTypeSynonym :: TagKind CTAG
- TkTypeSignature :: TagKind CTAG
- TkPatternSynonym :: TagKind CTAG
- TkTypeClass :: TagKind CTAG
- TkTypeClassMember :: TagKind CTAG
- TkTypeClassInstance :: TagKind CTAG
- TkTypeFamily :: TagKind CTAG
- TkTypeFamilyInstance :: TagKind CTAG
- TkDataTypeFamily :: TagKind CTAG
- TkDataTypeFamilyInstance :: TagKind CTAG
- TkForeignImport :: TagKind CTAG
- TkForeignExport :: TagKind CTAG
- CharKind :: !Char -> TagKind CTAG
- NoKind :: TagKind tk
- type CTagKind = TagKind CTAG
- type ETagKind = TagKind ETAG
- data TagDefinition (tk :: TAG_KIND) where
- TagDefinition :: !Text -> TagDefinition ETAG
- NoTagDefinition :: TagDefinition tk
- data TagFields (tk :: TAG_KIND) where
- type CTagFields = TagFields CTAG
- type ETagFields = TagFields ETAG
- data TagField = TagField {
- fieldName :: Text
- fieldValue :: Text
- compareTags :: forall (tk :: TAG_KIND). Ord (TagAddress tk) => Tag tk -> Tag tk -> Ordering
- combineTags :: (Tag tk -> Tag tk -> Ordering) -> FilePath -> [Tag tk] -> [Tag tk] -> [Tag tk]
- ghcTagToTag :: SingTagKind tk -> DynFlags -> GhcTag -> Maybe (Tag tk)
Tag
data SingTagKind (tk :: TAG_KIND) where Source #
Singletons for promoted types.
data Tag (tk :: TAG_KIND) Source #
Tag record. For either ctags or etags formats. It is either filled with information parsed from a tags file or from *GHC* ast.
Tag | |
|
Tag fields
ByteString
which encodes a tag name.
data TagAddress (tk :: TAG_KIND) where Source #
Tag address, either from a parsed file or from Haskell's AST>
TagLineCol :: !Int -> !Int -> TagAddress tk | Precise addres: line and column. This is what we infer from The two arguments are line number and either column number or offset from the begining of the file. |
TagLine :: !Int -> TagAddress CTAG | ctags can only use range ex-commands as an address (or a sequence of them separated by `;`). We parse line number specifically, since they are useful for ordering tags. |
TagCommand :: !ExCommand -> TagAddress CTAG | A tag address can be just an ex command. |
Instances
Eq (TagAddress tk) Source # | |
Defined in GhcTags.Tag (==) :: TagAddress tk -> TagAddress tk -> Bool # (/=) :: TagAddress tk -> TagAddress tk -> Bool # | |
Ord (TagAddress tk) Source # | |
Defined in GhcTags.Tag compare :: TagAddress tk -> TagAddress tk -> Ordering # (<) :: TagAddress tk -> TagAddress tk -> Bool # (<=) :: TagAddress tk -> TagAddress tk -> Bool # (>) :: TagAddress tk -> TagAddress tk -> Bool # (>=) :: TagAddress tk -> TagAddress tk -> Bool # max :: TagAddress tk -> TagAddress tk -> TagAddress tk # min :: TagAddress tk -> TagAddress tk -> TagAddress tk # | |
Show (TagAddress tk) Source # | |
Defined in GhcTags.Tag showsPrec :: Int -> TagAddress tk -> ShowS # show :: TagAddress tk -> String # showList :: [TagAddress tk] -> ShowS # |
type CTagAddress = TagAddress CTAG Source #
CTag
addresses.
type ETagAddress = TagAddress ETAG Source #
ETag
addresses.
data TagKind (tk :: TAG_KIND) where Source #
When we parse a tags
file we can eithera find no kind or recognize the
kind of GhcTagKind or we store the found character kind. This allows us to
preserve information from parsed tags files which were not created by
`ghc-tags-plugin'
TkTerm
-`
TkFunction
-λ
TkTypeConstructor
-Λ
TkDataConstructor
-c
TkGADTConstructor
-g
TkRecordField
-r
TkTypeSynonym
-≡
TkTypeSignature
-⊢
TkPatternSynonym
-p
TkTypeClass
-C
TkTypeClassMember
-m
TkTypeClassInstance
-i
TkTypeFamily
-f
TkTypeFamilyInstance
-F
TkDataTypeFamily
-d
TkDataTypeFamilyInstance
-D
TkForeignImport
-I
TkForeignExport
-E
Instances
Eq (TagKind tk) Source # | |
Ord (TagKind tk) Source # | |
Show (TagKind tk) Source # | |
data TagDefinition (tk :: TAG_KIND) where Source #
Emacs tags specific field.
TagDefinition :: !Text -> TagDefinition ETAG | |
NoTagDefinition :: TagDefinition tk |
Instances
Eq (TagDefinition tk) Source # | |
Defined in GhcTags.Tag (==) :: TagDefinition tk -> TagDefinition tk -> Bool # (/=) :: TagDefinition tk -> TagDefinition tk -> Bool # | |
Show (TagDefinition tk) Source # | |
Defined in GhcTags.Tag showsPrec :: Int -> TagDefinition tk -> ShowS # show :: TagDefinition tk -> String # showList :: [TagDefinition tk] -> ShowS # |
data TagFields (tk :: TAG_KIND) where Source #
Ctags specific list of TagField
s.
type CTagFields = TagFields CTAG Source #
type ETagFields = TagFields ETAG Source #
Unit of data associated with a tag. Vim natively supports `file:` and `kind:` tags but it can display any other tags too.
TagField | |
|
Ordering and combining tags
compareTags :: forall (tk :: TAG_KIND). Ord (TagAddress tk) => Tag tk -> Tag tk -> Ordering Source #
Total order relation on Tag
elements.
It sorts type classes / type families (TkTypeClass
, TkTypeFamily
,
TkDataTypeFamily
) before instances (TkTypeClassInstance
,
TkTypeFamilyInstance
, TkDataTypeFamilyInstance
); but also (as a side
effect of keeping transitivity property) it will put type classes and their
instances before other kinds.
It satisfies the following properties:
- anti-symmetry
- reflexivity
- transitivity
- partial consistency with
Eq
instance:
a == b => compareTags a b == EQ
combineTags :: (Tag tk -> Tag tk -> Ordering) -> FilePath -> [Tag tk] -> [Tag tk] -> [Tag tk] Source #
Create Tag
from a GhcTag
ghcTagToTag :: SingTagKind tk -> DynFlags -> GhcTag -> Maybe (Tag tk) Source #