fast-tags-1.4.1: Fast incremental vi and emacs tags.

Safe HaskellNone
LanguageHaskell98

FastTags.Vim

Description

Functions specific to vim tags.

Synopsis

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.

keyOnJust :: (a -> Maybe k) -> [a] -> [(k, a)] Source #

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.

data Parsed Source #

The Ord instance determines the sort order for the tags file.

Constructors

Parsed 

Fields

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

toType :: Type -> Char Source #

Vim takes this to be the "kind:" annotation. It's just an arbitrary string and these letters conform to no standard. Presumably there are some vim extensions that can make use of it.