Since V3, lh-tags introduces indexers. All indexers are meant to provide the same services. We are in a OO/Duck-typed world.
Indexers' job is to... index, as transparently as possible for the end-users. ctags-indexer provides a few other services in order to fill tag files with precise information on the code in the current buffer like local-variables, lines where functions are defined, and so on. Other indexers are yet to be written.
Returns the list of kind characters used in
taglist()
to store
functions for a given filetype.
Shortcut to get_kind_flags('function')
on the flavour of the current indexer.
Tells whether the specified filetype is explicitly requested to be indexed
with lh#tags#add_indexed_ft()
Registers the given filetypes to be indexed.
Indexers shall then ignore the files that don't belong to the registered filetypes. By default, the indexers will try to index all the files they understand.
Indexers like ctags
index files according to their extension. When we use non
standard extensions (like .tpp
in C++), we need to tell ctags
that all
*.tpp
files are C++ files.
lh-tags provides a unique function to register new extensions to a (Vim-)filetype.
Returns a tag session.
The session object returned:
- possesses a reference to the indexer used
- possesses the list of tags found
- possesses an internal counter to factorize multiple calls to
ctags
- can be
finalize()
d
Every time a session is requested, an internal counter is incremented. This
permits to request tags from multiple Vim functions executed together, several
times, and yet have the external ctags
executable run only once.
It's imperative to always execute session.finalize()
from a
:finally
block.
Each call to #get()
must be balanced with a call to finalize()
args
can contain:
firstline
, andlastline
to restrict the lines on which the analyse is performedindexer
, a name, or Funcref, to an indexer building function.- any parameter used by
indexer.cmd_line()
method -- BTW, the following are forcefully injected:forced_language
to&ft
,extract_local_variables'
to 1,end
to 1,extract_prototypes
to 0.
Runs the indexer on all files from a project.
Runs the indexer to update the tags associated to a file.
Runs the indexer to update the tags associated to a buffer -- non necessarily saved.
Method specific to ctags
-like indexers that fill tag file that can accessed
through taglist()
.
Tells whether there is a ctags kind associated to the specified pattern.
The kind_pattern
is expected to be a
regular-expression
.
The names/patterns officially supported follow current universal-ctags kinds.
Method specific to ctags
-like indexers that fill tag file that can accessed
through taglist()
.
Returns the kind letter that stores some information. The information is
identified through the kind_pattern
which is expected to be a
regular-expression
.
The names/patterns officially supported follow current universal-ctags kinds.
Returns tags associated to the current buffer. The tags extraction can be
restricted to lines between options.firstline
and options.lastline
if
specified.
This is internally used by lh#tags#session#*()
functions.
Changes the (tag) database filename.
ctags
indexer sets it by default to indexer.src_dirname() . indexer.db_filename()
in update_tags_option()
method.
Getter to DB filename property.
Returns the root directory where the sources are.
See the option
(bpg):paths.tags.src_dir
.
Some paths need to be translated when running Cygwin programs from Windows native flavour of Vim. This method takes care of that.
This is the factory function that builds new ctags
indexers.
Builds the command line to execute according to the various options passed.
Sets the filename of the tag database to indexer.src_dirname() . indexer.db_filename()
, and updates the
'tags'
options
accordingly.
Getter to the name of the tag file to use. Wraps access to
(bpg):tags_filename
option.
Getter that wraps access to (bpg):tags_executable
option.
Method to locally override the tag executable, if need be, in the restricted context of the indexer.
Internally the ctags indexer relies on another object to obtain precise information of what the exact flavour of ctags (exhuberant-ctags/universal-ctags) can support.