Loading ...
Sorry, an error occurred while loading the content.

Issue 90 in vim: incorrect parsing of exuberant ctags tags file

Expand Messages
  • vim@googlecode.com
    Status: New Owner: ---- Labels: Type-Defect Priority-Medium New issue 90 by darren.c...@gmail.com: incorrect parsing of exuberant ctags tags file
    Message 1 of 5 , Nov 2, 2012
    • 0 Attachment
      Status: New
      Owner: ----
      Labels: Type-Defect Priority-Medium

      New issue 90 by darren.c...@...: incorrect parsing of exuberant ctags
      tags file
      http://code.google.com/p/vim/issues/detail?id=90

      What steps will reproduce the problem?
      1. cd into vim/src
      2. Run ctags with case folding(ctags -R --sort=foldcase)
      3. Open vim/src/main.c
      4. Either run:
      :set tags=tags
      Or your vimrc will need to be set to load the tags file
      5. Go to line 208, and try to jump to definition for mch_fopen (CTRL-] is
      the specific command I'm using to try to jump)
      E432: Tags file not sorted: tags
      E426: tag not found: mch_fopen

      What is the expected output? What do you see instead?

      I'd expect to follow jump to the definition of mch_fopen. I get the errors
      list above instead
      E432: Tags file not sorted: tags
      E426: tag not found: mch_fopen

      What version of the product are you using? On what operating system?

      Centos6 up todate as of yesterday
      vim hg pull -u from a few days ago
      Features: huge
      Both python and ruby enabled and pointing to pythonbrew and rvm
      installations
      VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 30 2012 16:11:40)
      Included patches: 1-712
      ctags version: 5.8

      Please provide any additional information below.

      If you look at the tags file you'll see a line at the top starting:
      !rm
      Which due to foldcase has been sorted before the "!_TAG_XXXXX" lines.
      This is valid tags file according to: http://ctags.sourceforge.net/FORMAT
      Written by Bram and Darren Hiebert

      Particularly:

      The names of the tags used in these lines may be suitably chosen to
      ensure
      that when sorted, they will always be located near the first lines of
      the tag
      file. The use of "!_TAG_" is recommended. Note that a rare tag
      like "!"
      can sort to before these lines. The program reading the tags file
      should be
      smart enough to skip over these tags.

      Vim is failing to read far enough into the file and assumes that the file
      isn't sorted even though it is, which then leads down to further errors and
      not finding the tag that is there. I looked a few weeks ago at tag.c I
      think TS_START is getting unset too soon (though it might need more work
      than that). Vim might need to readjust how it searches when it
      finds "!_TAG_XXXX" lines. I didn't have the time to try coming up with a
      patch (or even to file a bug until today....)

      If you don't set ctags to foldcase things will work (maybe not as fast a
      tags lookup when ignorecase is set). I have a few other source trees I'm
      working with that have some other rare tags that get sorted above
      the "!_TAG_XXXX" set of lines, and seen similar problems.

      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • vim@...
      Comment #1 on issue 90 by chrisbr...@googlemail.com: incorrect parsing of exuberant ctags tags file http://code.google.com/p/vim/issues/detail?id=90 I am not
      Message 2 of 5 , Jan 28, 2013
      • 0 Attachment
        Comment #1 on issue 90 by chrisbr...@...: incorrect parsing of
        exuberant ctags tags file
        http://code.google.com/p/vim/issues/detail?id=90

        I am not able to reproduce the problem. It works here without any problems.

        Vim version 7.3.753 and 7.3.785
        ctags:
        Exuberant Ctags 5.9~svn20110310, Copyright (C) 1996-2009 Darren Hiebert
        Compiled: Apr 30 2012, 19:23:25
        Addresses: <dhiebert@...>, http://ctags.sourceforge.net
        Optional compiled features: +wildcards, +regex

        Perhaps, you need a newer ctags version?

        --
        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • vim@...
        Comment #2 on issue 90 by lech.lor...@gmail.com: incorrect parsing of exuberant ctags tags file http://code.google.com/p/vim/issues/detail?id=90 I can
        Message 3 of 5 , Jan 28, 2013
        • 0 Attachment
          Comment #2 on issue 90 by lech.lor...@...: incorrect parsing of
          exuberant ctags tags file
          http://code.google.com/p/vim/issues/detail?id=90

          I can reproduce something similar. I prepare the file as specified by the
          OP and then instead of using normal-mode tag command I try to execute a
          command-line mode command:
          :tag !
          and after the exclamation point I use TAB to get possible completions. This
          results in E432 and - surprisingly - a list of completions.

          I'm working under Cygwin with the following versions:
          Vim 7.3.772
          Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert

          --
          --
          You received this message from the "vim_dev" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_dev" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • vim@...
          Comment #3 on issue 90 by darren.c...@gmail.com: incorrect parsing of exuberant ctags tags file http://code.google.com/p/vim/issues/detail?id=90 I still get an
          Message 4 of 5 , Jan 28, 2013
          • 0 Attachment
            Comment #3 on issue 90 by darren.c...@...: incorrect parsing of
            exuberant ctags tags file
            http://code.google.com/p/vim/issues/detail?id=90

            I still get an error, but only the second one. Followed the same test as
            above but running binaries from the just build source trees. Here are the
            details.

            Built vim from source pulled down today (7.3.785) and ctags from svn source
            pulled today (svn rev 804)

            I ran the vim binary from within the tree. I ran without any vim runtime
            files installed. I moved aside my .vim, .vimrc (though I get the same
            error even with my setup and no runtime files). Default value for tags
            option used was: tags=./tags,tags

            I ran ctags from the source tree I built. The files have differences from
            each other, but there is still a !rm tag sorted to the top and tag lines
            for mch_fopen exist (though there are differences in those lines). Again
            ctags run with case folding: ctags -R --sort=foldcase

            I still get an error, but only the second one:
            E426: tag not found: mch_fopen

            If I run than vim compiled today with a tags file from the installed ctags
            (5.8) I get the same two errors in my original report. So ctags version is
            having some affect.

            I haven't looked at the source yet to see what is going wrong. I wonder if
            the line ctags header line:
            !_TAG_PROGRAM_VERSION Development
            Is causing problems with my tests.

            I use vim on a daily basis so I'm very willing to help. Though I don't
            know when I'll have a chance to step through the vim code to see if I can
            find the problem.



            Some further details on exactly what I am running.

            I'm running on Mac OS 10.7.5

            vim built source pulled down today first few lines of --version
            VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jan 28 2013 08:25:37)
            MacOS X (unix) version
            Included patches: 1-785

            ctags built from source doesn't show 5.9, but development instead. I built
            from trunk. lines from --version
            Exuberant Ctags Development, Copyright (C) 1996-2009 Darren Hiebert
            Compiled: Jan 28 2013, 08:33:37
            Addresses: <dhiebert@...>,
            http://ctags.sourceforge.net
            Optional compiled features: +wildcards, +regex
            Maybe that was because of how I ran autoheader, autoconf, and then
            just ./configure --prefix=.... I didn't get the 5.9 version

            --
            --
            You received this message from the "vim_dev" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php

            ---
            You received this message because you are subscribed to the Google Groups "vim_dev" group.
            To unsubscribe from this group, send email to vim_dev+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • vim@...
            Updates: Status: Fixed Comment #4 on issue 90 by brammool...@gmail.com: incorrect parsing of exuberant ctags tags file
            Message 5 of 5 , Jun 15, 2013
            • 0 Attachment
              Updates:
              Status: Fixed

              Comment #4 on issue 90 by brammool...@...: incorrect parsing of
              exuberant ctags tags file
              http://code.google.com/p/vim/issues/detail?id=90

              Problem is that case-folding sorts a tag such as "!rm" before "!_TAG", but
              the check for the end of the header does not take that into account. With
              the result that the header line indicating that the tags file is
              case-folded is not found

              Fixed by patch 7.3.1202.

              --
              You received this message because this project is configured to send all
              issue notifications to this address.
              You may adjust your notification preferences at:
              https://code.google.com/hosting/settings

              --
              --
              You received this message from the "vim_dev" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php

              ---
              You received this message because you are subscribed to the Google Groups "vim_dev" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            Your message has been successfully submitted and would be delivered to recipients shortly.