Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
GhcTags.Tag
Synopsis
- data TAG_KIND
- data SingTagKind (tk :: TAG_KIND) where
- data Tag (tk :: TAG_KIND) = Tag {
- tagName :: !TagName
- tagKind :: !TagKind
- tagFilePath :: !TagFilePath
- tagAddr :: !(TagAddress tk)
- tagDefinition :: !(TagDefinition tk)
- tagFields :: !(TagFields tk)
- type ETag = Tag ETAG
- type CTag = Tag CTAG
- type ETagMap = TagMap ETAG
- type CTagMap = TagMap CTAG
- newtype TagName = TagName {
- getTagName :: Text
- newtype TagFilePath = TagFilePath {}
- newtype ExCommand = ExCommand {
- getExCommand :: Text
- data TagAddress (tk :: TAG_KIND) where
- TagLineCol :: !Int -> !Int -> TagAddress tk
- TagLine :: !Int -> TagAddress tk
- TagCommand :: !ExCommand -> TagAddress CTAG
- NoAddress :: TagAddress ETAG
- type CTagAddress = TagAddress CTAG
- type ETagAddress = TagAddress ETAG
- data TagKind where
- TkModule :: TagKind
- TkTerm :: TagKind
- TkFunction :: TagKind
- TkTypeConstructor :: TagKind
- TkDataConstructor :: TagKind
- TkGADTConstructor :: TagKind
- TkRecordField :: TagKind
- TkTypeSynonym :: TagKind
- TkTypeSignature :: TagKind
- TkPatternSynonym :: TagKind
- TkTypeClass :: TagKind
- TkTypeClassMember :: TagKind
- TkTypeClassInstance :: TagKind
- TkTypeClassInstanceMember :: TagKind
- TkTypeFamily :: TagKind
- TkTypeFamilyInstance :: TagKind
- TkDataTypeFamily :: TagKind
- TkDataTypeFamilyInstance :: TagKind
- TkForeignImport :: TagKind
- TkForeignExport :: TagKind
- CharKind :: !Char -> TagKind
- NoKind :: TagKind
- type CTagKind = TagKind
- type ETagKind = TagKind
- 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) -> RawFilePath -> [Tag tk] -> [Tag tk] -> [Tag tk]
- type RawFilePath = ByteString
- rawFilePathToBS :: RawFilePath -> ByteString
- rawFilePathFromBS :: ByteString -> RawFilePath
- normaliseRawFilePath :: RawFilePath -> RawFilePath
- makeRelativeRawFilePath :: RawFilePath -> RawFilePath -> RawFilePath
- (</>) :: RawFilePath -> RawFilePath -> RawFilePath
- ghcTagToTag :: SingTagKind tk -> DynFlags -> GhcTag -> Maybe (Tag tk)
Tag
data SingTagKind (tk :: TAG_KIND) where Source #
Singletons for promoted types.
Constructors
SingCTag :: SingTagKind CTAG | |
SingETag :: SingTagKind ETAG |
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.
Constructors
Tag | |
Fields
|
Tag fields
ByteString
which encodes a tag name.
Constructors
TagName | |
Fields
|
newtype TagFilePath Source #
Constructors
TagFilePath | |
Fields |
Instances
Show TagFilePath Source # | |
Defined in GhcTags.Tag Methods showsPrec :: Int -> TagFilePath -> ShowS # show :: TagFilePath -> String # showList :: [TagFilePath] -> ShowS # | |
NFData TagFilePath Source # | |
Defined in GhcTags.Tag Methods rnf :: TagFilePath -> () # | |
Eq TagFilePath Source # | |
Defined in GhcTags.Tag | |
Ord TagFilePath Source # | |
Defined in GhcTags.Tag Methods compare :: TagFilePath -> TagFilePath -> Ordering # (<) :: TagFilePath -> TagFilePath -> Bool # (<=) :: TagFilePath -> TagFilePath -> Bool # (>) :: TagFilePath -> TagFilePath -> Bool # (>=) :: TagFilePath -> TagFilePath -> Bool # max :: TagFilePath -> TagFilePath -> TagFilePath # min :: TagFilePath -> TagFilePath -> TagFilePath # |
Constructors
ExCommand | |
Fields
|
Instances
Show ExCommand Source # | |
Eq ExCommand Source # | |
Ord ExCommand Source # | |
data TagAddress (tk :: TAG_KIND) where Source #
Tag address, either from a parsed file or from Haskell's AST>
Constructors
TagLineCol :: !Int -> !Int -> TagAddress tk | Precise address: line and column. This is what we infer from The two arguments are line number and either column number or offset from the beginning of the file. |
TagLine :: !Int -> TagAddress tk | 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. |
NoAddress :: TagAddress ETAG | etags file format allows to discard the address |
Instances
Show (TagAddress tk) Source # | |
Defined in GhcTags.Tag Methods showsPrec :: Int -> TagAddress tk -> ShowS # show :: TagAddress tk -> String # showList :: [TagAddress tk] -> ShowS # | |
NFData (TagAddress tt) Source # | |
Defined in GhcTags.Tag Methods rnf :: TagAddress tt -> () # | |
Eq (TagAddress tk) Source # | |
Defined in GhcTags.Tag Methods (==) :: TagAddress tk -> TagAddress tk -> Bool # (/=) :: TagAddress tk -> TagAddress tk -> Bool # | |
Ord (TagAddress tk) Source # | |
Defined in GhcTags.Tag Methods 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 # |
type CTagAddress = TagAddress CTAG Source #
CTag
addresses.
type ETagAddress = TagAddress ETAG Source #
ETag
addresses.
When we parse a tags
file we can either 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
TkTypeClassInstanceMember
-i
TkTypeFamily
-f
TkTypeFamilyInstance
-F
TkDataTypeFamily
-d
TkDataTypeFamilyInstance
-D
TkForeignImport
-I
TkForeignExport
-E
Constructors
data TagDefinition (tk :: TAG_KIND) where Source #
Emacs tags specific field.
Constructors
TagDefinition :: !Text -> TagDefinition ETAG | |
NoTagDefinition :: TagDefinition tk |
Instances
Show (TagDefinition tk) Source # | |
Defined in GhcTags.Tag Methods showsPrec :: Int -> TagDefinition tk -> ShowS # show :: TagDefinition tk -> String # showList :: [TagDefinition tk] -> ShowS # | |
NFData (TagDefinition tt) Source # | |
Defined in GhcTags.Tag Methods rnf :: TagDefinition tt -> () # | |
Eq (TagDefinition tk) Source # | |
Defined in GhcTags.Tag Methods (==) :: TagDefinition tk -> TagDefinition tk -> Bool # (/=) :: TagDefinition tk -> TagDefinition tk -> Bool # | |
Ord (TagDefinition tk) Source # | |
Defined in GhcTags.Tag Methods compare :: TagDefinition tk -> TagDefinition tk -> Ordering # (<) :: TagDefinition tk -> TagDefinition tk -> Bool # (<=) :: TagDefinition tk -> TagDefinition tk -> Bool # (>) :: TagDefinition tk -> TagDefinition tk -> Bool # (>=) :: TagDefinition tk -> TagDefinition tk -> Bool # max :: TagDefinition tk -> TagDefinition tk -> TagDefinition tk # min :: TagDefinition tk -> TagDefinition tk -> TagDefinition tk # |
data TagFields (tk :: TAG_KIND) where Source #
Ctags specific list of TagField
s.
Instances
Monoid (TagFields 'CTAG) Source # | |
Monoid (TagFields 'ETAG) Source # | |
Semigroup (TagFields tk) Source # | Left biased semigroup. |
Show (TagFields tk) Source # | |
NFData (TagFields tk) Source # | |
Defined in GhcTags.Tag | |
Eq (TagFields tk) Source # | |
Ord (TagFields tk) Source # | |
Defined in GhcTags.Tag |
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.
Constructors
TagField | |
Fields
|
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) -> RawFilePath -> [Tag tk] -> [Tag tk] -> [Tag tk] Source #
File paths
type RawFilePath = ByteString #
A literal POSIX file path
(</>) :: RawFilePath -> RawFilePath -> RawFilePath Source #
Create Tag
from a GhcTag
ghcTagToTag :: SingTagKind tk -> DynFlags -> GhcTag -> Maybe (Tag tk) Source #