Menu

#197 "ignoring null tag" warning

closed
None
5
2008-03-29
2007-10-07
No

Running ctags 5.7 (from Ubuntu Gutsy beta) on a Python file that contains something like this:

def x ():
a=_class
""

Leads to this warning being printed:

ctags: Warning: ignoring null tag in test-ctags.py

The example code looks very artificial, but is in fact valid Python code. The important parts are the string "class" at the end of line 2 and the second " character at the end of line 3. You can put anything before "class" and " in line 2 and 3, it will always trigger the warning as long as the strings appear shifted by 2 columns. You can also replace "class" with "def".

This works fine with ctags 5.6 from Ubuntu Feisty.

My real code portion that triggers the warning is this part of a class method:

>>>>>>>>

def detach (self):

model = self.view.props.model
sort_id, sort_order = tree_sortable_get_sort_column_id (model)
if sort_id >= 0:
self.app.state.sort_column = self.find_item_class (id = sort_id)
if sort_order == gtk.SORT_ASCENDING:
self.app.state.sort_order = "ascending"
else:
self.app.state.sort_order = "descending"

>>>>>>>>>>

Here, the expression "self.find_item_class" has the triggering "class" string. The " match is the closing quote of the "ascending" string two lines below that.

Strange, isn't it?

Discussion

  • Elliott Hughes

    Elliott Hughes - 2007-10-07
    • assigned_to: nobody --> elias
     
  • Elliott Hughes

    Elliott Hughes - 2007-10-07

    Logged In: YES
    user_id=1127237
    Originator: NO

    (assigning to elias, ctags' Python maintainer.)

     
  • Elias Pschernig

    Elias Pschernig - 2007-10-07

    Logged In: YES
    user_id=32894
    Originator: NO

    I cannot reproduce this with SVN trunk (revision 628). Did you use any options to ctags? I tried both examples, and here I get a single function "x" and "detach", respectively. Without any warnings.

     
  • René Stadler

    René Stadler - 2007-10-07

    Logged In: YES
    user_id=1907692
    Originator: YES

    Tried SVN trunk now, same thing. You don't even need a method, just write

    x=_class
    ""

    at toplevel.

     
  • Elias Pschernig

    Elias Pschernig - 2007-10-07

    Logged In: YES
    user_id=32894
    Originator: NO

    For some reason, passing --enable-maintainermode to configure made the warning not appear. Building normally, I could reproduce and committed a fix to svn (revision 629). Since you already tried the SVN version, maybe you can confirm that it fixes the problem.

     
  • René Stadler

    René Stadler - 2007-10-07

    Logged In: YES
    user_id=1907692
    Originator: YES

    Confirming, SVN trunk works now.

     
  • Elliott Hughes

    Elliott Hughes - 2008-03-29

    Logged In: YES
    user_id=1127237
    Originator: NO

    (closing because the submitter has confirmed the fix, a test case has been added, and the NEWS file has been updated.)

     
  • Elliott Hughes

    Elliott Hughes - 2008-03-29
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB