yi-core-0.19.4: Yi editor core library

License | GPL-2
Maintainer | yi-devel@googlegroups.com
Stability | experimental
Portability | portable
Safe Haskell | None
Language | Haskell2010

Extensions

- Cpp
- TemplateHaskell
- TemplateHaskellQuotes
- OverloadedStrings
- DeriveDataTypeable
- DeriveGeneric
- FlexibleContexts
- GeneralizedNewtypeDeriving

Yi.Tag

Description

A module for CTags integration. Note that this reads the ‘tags’ file produced by `hasktags`, not the ‘TAGS’ file which uses a different format (etags).

Synopsis

- lookupTag :: Tag -> TagTable -> [(FilePath, Int)]
- importTagTable :: FilePath -> IO TagTable
- hintTags :: TagTable -> Text -> [Text]
- completeTag :: TagTable -> Text -> Text
- newtype Tag = Tag {
  - _unTag :: Text
  }
- unTag' :: Tag -> Text
- data TagTable = TagTable {
  - tagFileName :: FilePath
  - tagBaseDir :: FilePath
  - tagFileMap :: Map Tag [(FilePath, Int)]
  - tagCompletionTree :: CompletionTree Text
  }
- getTags :: EditorM (Maybe TagTable)
- setTags :: TagTable -> EditorM ()
- resetTags :: EditorM ()
- tagsFileList :: Field [FilePath]
- readCTags :: Text -> Map Tag [(FilePath, Int)]

# Documentation

lookupTag :: Tag -> TagTable -> [(FilePath, Int)] Source #

Find the location of a tag using the tag table. Returns a full path and line number

importTagTable :: FilePath -> IO TagTable Source #

Read in a tag file from the system

hintTags :: TagTable -> Text -> [Text] Source #

Gives all the possible expanded tags that could match a given `prefix`

completeTag :: TagTable -> Text -> Text Source #

Extends the string to the longest certain length

newtype Tag Source #

Constructors

Tag |

Fields

- _unTag :: Text

#### Instances

Instances details

Binary Tag Source # |
Instance details Defined in Yi.Tag Methods put :: Tag -> Put Source # get :: Get Tag Source # putList :: [Tag] -> Put Source #
Show Tag Source # |
Instance details Defined in Yi.Tag Methods showsPrec :: Int -> Tag -> ShowS Source # show :: Tag -> String Source # showList :: [Tag] -> ShowS Source #
Eq Tag Source # |
Instance details Defined in Yi.Tag Methods (==) :: Tag -> Tag -> Bool Source # (/=) :: Tag -> Tag -> Bool Source #
Ord Tag Source # |
Instance details Defined in Yi.Tag Methods compare :: Tag -> Tag -> Ordering Source # (<) :: Tag -> Tag -> Bool Source # (<=) :: Tag -> Tag -> Bool Source # (>) :: Tag -> Tag -> Bool Source # (>=) :: Tag -> Tag -> Bool Source # max :: Tag -> Tag -> Tag Source # min :: Tag -> Tag -> Tag Source #

unTag' :: Tag -> Text Source #

data TagTable Source #

Constructors

TagTable |

Fields

- tagFileName :: FilePath

  local name of the tag file TODO: reload if this file is changed

- tagBaseDir :: FilePath

  path to the tag file directory tags are relative to this path

- tagFileMap :: Map Tag [(FilePath, Int)]

  map from tags to files

- tagCompletionTree :: CompletionTree Text

  trie to speed up tag hinting

#### Instances

Instances details

Binary TagTable Source # |
Instance details Defined in Yi.Tag Methods put :: TagTable -> Put Source # get :: Get TagTable Source # putList :: [TagTable] -> Put Source #
Generic TagTable Source # |

Instance details

Defined in Yi.Tag

Associated Types

type Rep TagTable |

Instance details

Defined in Yi.Tag

type Rep TagTable = D1 ('MetaData "TagTable" "Yi.Tag" "yi-core-0.19.4-4E7mid7TC5Y9v8ChZSA8gi" 'False) (C1 ('MetaCons "TagTable" 'PrefixI 'True) ((S1 ('MetaSel ('Just "tagFileName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Just "tagBaseDir") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath)) :*: (S1 ('MetaSel ('Just "tagFileMap") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map Tag [(FilePath, Int)])) :*: S1 ('MetaSel ('Just "tagCompletionTree") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (CompletionTree Text)))))

Methods

from :: TagTable -> Rep TagTable x Source #

to :: Rep TagTable x -> TagTable Source #

type Rep TagTable Source # |

Instance details

Defined in Yi.Tag

type Rep TagTable = D1 ('MetaData "TagTable" "Yi.Tag" "yi-core-0.19.4-4E7mid7TC5Y9v8ChZSA8gi" 'False) (C1 ('MetaCons "TagTable" 'PrefixI 'True) ((S1 ('MetaSel ('Just "tagFileName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Just "tagBaseDir") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath)) :*: (S1 ('MetaSel ('Just "tagFileMap") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map Tag [(FilePath, Int)])) :*: S1 ('MetaSel ('Just "tagCompletionTree") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (CompletionTree Text)))))

getTags :: EditorM (Maybe TagTable) Source #

Get the currently registered tag table

setTags :: TagTable -> EditorM () Source #

Set a new TagTable

resetTags :: EditorM () Source #

Reset the TagTable

tagsFileList :: Field [FilePath] Source #

readCTags :: Text -> Map Tag [(FilePath, Int)] Source #

Super simple parsing CTag format 1 parsing algorithm TODO: support search patterns in addition to lineno