Skip to content

Universal Ctags

Carlos Paradis edited this page Jul 31, 2020 · 5 revisions

ctags --list-fields

Fields control what metadata uctags will add to the parsed source code file. You can think of this flag as specifying what columns appear in the output file. Relevant field documentation for our use of uctags. See the tags file format and also the docs by searching for --fields=[+|-]flags|*. We use n,e,k to provide the start line, end line, and fields (as described next) with a single letter. These flags are hardcoded into parse_line_type_file() because they affect the format the parse function should expect to parse.

ctags --list-kinds

Kinds control what source code lines will be annotated by uctags with a language entity (e.g. function, method, class, etc). You can think of this flag as specifying what rows appear in the output file. Because what constitutes a "correct flag" is subject to the research question, these flags are decided at the project configuration file.

Relevant flag documentation for our use of uctags. See the brief definition of kinds and also the docs by searching for --kinds-<LANG>=[+|-]kinds|*. Many more languages are supported by uctags, however for the scope of this work we currently only consider the languages below.

C

C
    d  macro definitions
    e  enumerators (values inside an enumeration)
    f  function definitions
    g  enumeration names
    h  included header files
    l  local variables [off]
    m  struct, and union members
    p  function prototypes [off]
    s  structure names
    t  typedefs
    u  union names
    v  variable definitions
    x  external and forward variable declarations [off]
    z  function parameters inside function definitions [off]
    L  goto labels [off]
    D  parameters inside macro definitions [off]

C++

    d  macro definitions
    e  enumerators (values inside an enumeration)
    f  function definitions
    g  enumeration names
    h  included header files
    l  local variables [off]
    m  class, struct, and union members
    p  function prototypes [off]
    s  structure names
    t  typedefs
    u  union names
    v  variable definitions
    x  external and forward variable declarations [off]
    z  function parameters inside function definitions [off]
    L  goto labels [off]
    D  parameters inside macro definitions [off]
    c  classes
    n  namespaces
    A  namespace aliases [off]
    N  names imported via using scope::symbol [off]
    U  using namespace statements [off]
    Z  template parameters [off]

Java

    a  annotation declarations
    c  classes
    e  enum constants
    f  fields
    g  enum types
    i  interfaces
    l  local variables [off]
    m  methods
    p  packages

Python

    c  classes
    f  functions
    m  class members
    v  variables
    I  name referring a module defined in other file
    i  modules
    x  name referring a class/variable/function/module defined in other module
    z  function parameters [off]
    l  local variables [off]

R

    f  functions
    l  libraries
    s  sources
    g  global variables
    v  function variables
    z  function parameters inside function definitions [off]
Clone this wiki locally