Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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.
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.
newtype TagFilePath Source #
Instances
Show TagFilePath Source # | |
Defined in GhcTags.Tag showsPrec :: Int -> TagFilePath -> ShowS # show :: TagFilePath -> String # showList :: [TagFilePath] -> ShowS # | |
NFData TagFilePath Source # | |
Defined in GhcTags.Tag rnf :: TagFilePath -> () # | |
Eq TagFilePath Source # | |
Defined in GhcTags.Tag (==) :: TagFilePath -> TagFilePath -> Bool # (/=) :: TagFilePath -> TagFilePath -> Bool # | |
Ord TagFilePath Source # | |
Defined in GhcTags.Tag compare :: TagFilePath -> TagFilePath -> Ordering # (<) :: TagFilePath -> TagFilePath -> Bool # (<=) :: TagFilePath -> TagFilePath -> Bool # (>) :: TagFilePath -> TagFilePath -> Bool # (>=) :: TagFilePath -> TagFilePath -> Bool # max :: TagFilePath -> TagFilePath -> TagFilePath # min :: TagFilePath -> TagFilePath -> TagFilePath # |
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 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 showsPrec :: Int -> TagAddress tk -> ShowS # show :: TagAddress tk -> String # showList :: [TagAddress tk] -> ShowS # | |
NFData (TagAddress tt) Source # | |
Defined in GhcTags.Tag rnf :: TagAddress tt -> () # | |
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 # |
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
data TagDefinition (tk :: TAG_KIND) where Source #
Emacs tags specific field.
TagDefinition :: !Text -> TagDefinition ETAG | |
NoTagDefinition :: TagDefinition tk |
Instances
Show (TagDefinition tk) Source # | |
Defined in GhcTags.Tag showsPrec :: Int -> TagDefinition tk -> ShowS # show :: TagDefinition tk -> String # showList :: [TagDefinition tk] -> ShowS # | |
NFData (TagDefinition tt) Source # | |
Defined in GhcTags.Tag rnf :: TagDefinition tt -> () # | |
Eq (TagDefinition tk) Source # | |
Defined in GhcTags.Tag (==) :: TagDefinition tk -> TagDefinition tk -> Bool # (/=) :: TagDefinition tk -> TagDefinition tk -> Bool # | |
Ord (TagDefinition tk) Source # | |
Defined in GhcTags.Tag 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.
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) -> 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 #