tagbar icon indicating copy to clipboard operation
tagbar copied to clipboard

Question about tagfield handling in tagbar

Open masatake opened this issue 8 years ago • 2 comments

Hi,

I'm a co-developer of universal ctags(https://ctags.io). I would like to know the way how tagbar handles "tagfield" in a tags file. As explained in http://ctags.sourceforge.net/FORMAT, "name" part of tagfield is specified as

6. Proposal
-----------

Use a comment after the {tagaddress} field.  The format would be:

    {tagname}<Tab>{tagfile}<Tab>{tagaddress}[;"<Tab>{tagfield}..]
   ...
   {tagaddress} Any Ex command.  When executed, it behaves like 'magic' was
        not set.  It may be restricted to a line number or a search
        pattern (Posix).
    ...
   {tagfield}   See below. 

A tagfield has a name, a colon, and a value: "name:value".
- The name consist only out of alphabetical characters.  Upper and lower case
  are allowed.  Lower case is recommended.  Case matters ("kind:" and "Kind:
  are different tagfields).

In universal ctags I would like to violate the rule. I would like to introduce a word separator like ' '(space), '-', or '_'. e.g.

-28,6 +28,7 input.diff  /^@@ -28,6 +28,7 @@$/;" h   modified file:a/main/parsers.h

In this tag file modified file is used as tagfield.

I heard tagbar doens't work if ' '(space) is used as the work separator. So I'm looking for alternative character. Candidates are _ and -. Do you have any recommendation? Or such violation is not acceptable?

Using camel case like modifiedFile can be used but I don't like it. So I would like to use camel case only if tagbar accepts only alphabetical characters.

masatake avatar Aug 29 '15 16:08 masatake

About this issue ctags developers are discussed at https://github.com/universal-ctags/ctags/pull/503 .

masatake avatar Aug 29 '15 16:08 masatake

Hey, sorry for the really late reply. In case it is still relevant, at the moment Tagbar uses \w to match field names, so it can deal with _ in them, but not with - or spaces. But I don't really see an issue with allowing both of them, since only tabs and colons are special as separator characters.

majutsushi avatar Sep 23 '16 01:09 majutsushi