Safe Haskell | None |
---|---|
Language | Haskell98 |
Functions specific to vim tags.
- merge :: Int -> [FilePath] -> [[Pos TagVal]] -> [Text] -> [Text]
- keyOnJust :: (a -> Maybe k) -> [a] -> [(k, a)]
- dropAdjacent :: Int -> [(Parsed, a)] -> [(Parsed, a)]
- dropAdjacentInFile :: (a -> Int) -> Int -> [a] -> [a]
- data Parsed = Parsed {}
- parseTag :: Text -> Maybe Parsed
- vimMagicLine :: Text
- showTag :: Pos TagVal -> Text
- toType :: Type -> Char
- fromType :: Char -> Maybe Type
Documentation
merge :: Int -> [FilePath] -> [[Pos TagVal]] -> [Text] -> [Text] Source #
Format new tags, drop old tags from the loaded files, merge old and new, and sort.
dropAdjacent :: Int -> [(Parsed, a)] -> [(Parsed, a)] Source #
If there are multiple tags with the same name and filename within a few lines, drop all but the first.
dropAdjacentInFile :: (a -> Int) -> Int -> [a] -> [a] Source #
Split this out so I can share it with emacs.
The Ord instance determines the sort order for the tags file.
vimMagicLine :: Text Source #
This line is to tell vim that the file is sorted, so it can use binary search when looking for tags. This must come first in the tags file, and the format is documented in :h tags-file-format as:
!_TAG_FILE_SORTEDTab1Tab{anything}
However, simply leaving {anything} part empty or putting something random like ~ doesn't work when we want to extend the tags file with some tags from C files using ctags. ctags requires //, with optional comments in between two slashes. More about ctags' file format can be seen here: http://ctags.sourceforge.net/FORMAT.
showTag :: Pos TagVal -> Text Source #
Convert a Tag to text, e.g.: AbsoluteMarktCmd/TimeStep.hs 67 ;" f