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

Re: Is this ccomplete's bug?

Expand Messages
  • jason
    Hi Dominique I don t use omnicppcomplete-0.41, I use vim s default omnicomplete function. These is my .vimrc setting about omnicomplete function: set
    Message 1 of 10 , Oct 1, 2009
    • 0 Attachment
      Hi Dominique
      I don't use omnicppcomplete-0.41, I use vim's default omnicomplete function.
      These is my .vimrc setting about omnicomplete function:
      set completeopt=menu,longest
      set omnifunc=ccomplete#Complete
      My vim version is 7.2.0 in Windows and 7.2.245 in Slackware 13.0.
      Ctags is 5.7. I just run "ctags -R ." in working dir.
      In your screenshot, you inserted a space before "sA.", which changed to
      "pb-> sA.", not "pb->sA.".
      My problem is that if I don't insert space before "sA.", just "pb->sA.",
      then put cursor behind "sA.", press C-X C-O,
      omnicomplete's completion information is members of struct tagBBB,
      but not members of struct tagAAA.
      Thanks!
      B.R.



      2009/10/1 Dominique Pellé <dominique.pelle@...>

      jason wrote:

      > I found ccomplete function is not OK for every time.
      > As first_level_ok.jpg shows, I have generated tags by ctags.
      > When I press C-X C-O after "pb->", it completed OK, and I selected "sA".
      > Now I press C-X C-O again, it show error completion info.
      > It just the same as first one. Second_level_error.jpg shows the error info.
      > If I input a space before "sA", and put the cursor behind of "sA.",
      > then press C-X C-O again, it show right completion info.
      > As second_level_ok.jpg shows.
      > I am no sure whether you can see these pictures.
      > Thanks.
      > B.R.

      Hi Jason

      I could not reproduce this bug using Linux x86, Vim-7.2.262,
      ctags-5.7 and omnicppcomplete-0.41 plugin.

      Completion works fine for me as shown in this screenshot:

       http://dominique.pelle.free.fr/pic/tag-ok.png

      But I see different information in the pum than what you
      show in your screenshot.  So I must not be using the
      same options.

      I created the tag file as follows:

      :!ctags -R --c++-kinds=+p --fields=+iaSn --extra=+q .

      And in my ~/.vimrc, I have:

      " OmniCppComplete
      if version >= 700
       if has('insert_expand')
         let OmniCpp_NamespaceSearch   = 1
         let OmniCpp_GlobalScopeSearch = 1
         let OmniCpp_ShowAccess        = 1
         let OmniCpp_MayCompleteDot    = 1
         let OmniCpp_MayCompleteArrow  = 1
         let OmniCpp_MayCompleteScope  = 1
         let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]

         if has('autocmd')
           " Automatically open/close the preview window.
           au CursorMovedI,InsertLeave * if pumvisible() == 0 | sil! pclose | endif
           set completeopt=menuone,longest,preview
         endif
       endif
      endif

      set tags=tags
      set wildmode=longest,list
      set wildmenu


      Some questions:
      - which version of Vim, ctags, and omni completion plugin are you using?
      - how did you create the tag file?

      Regards
      -- Dominique




      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---

    • Brett Stahlman
      ... Jason, I see the same behavior as you. In fact, you will see the same list of members even if you use aa or bb instead of sA. I haven t looked at it in
      Message 2 of 10 , Oct 1, 2009
      • 0 Attachment
        On Oct 1, 6:30 am, jason <beyond...@...> wrote:
        > Hi Dominique
        > I don't use omnicppcomplete-0.41, I use vim's default omnicomplete function.
        > These is my .vimrc setting about omnicomplete function:
        > set completeopt=menu,longest
        > set omnifunc=ccomplete#Complete
        > My vim version is 7.2.0 in Windows and 7.2.245 in Slackware 13.0.
        > Ctags is 5.7. I just run "ctags -R ." in working dir.
        > In your screenshot, you inserted a space before "sA.", which changed to
        > "pb-> sA.", not "pb->sA.".
        > My problem is that if I don't insert space before "sA.", just "pb->sA.",
        > then put cursor behind "sA.", press C-X C-O,
        > omnicomplete's completion information is members of struct tagBBB,
        > but not members of struct tagAAA.
        > Thanks!
        > B.R.

        Jason,
        I see the same behavior as you. In fact, you will see the same list of
        members even if you use aa or bb instead of sA. I haven't looked at it
        in detail, but a quick glance at the ccomplete.vim file leads me to
        suspect that it doesn't contain the recursive logic to traverse a
        sequence of nested structures. I believe that for a . or ->
        completion, it looks all the way back to the beginning of the WORD
        (unbroken sequence of non-whitespace, including . and ->) to determine
        the type whose members will be displayed in the popup. If you type...
        pb->aa.bb.cc.something_silly.<C-X><C-O>
        ...you will still see the members of BB in the popup; i.e., only the
        type of pb matters.

        As Dominique pointed out, omnicppcomplete doesn't suffer from this
        limitation, and it works for C and C++. Incidentally, does anyone know
        whether Vissale Neang still maintains the omnicppcomplete plugin? I
        haven't gotten responses to a post and a private email on several
        omnicppcomplete issues...

        Thanks,
        Brett Stahlman

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • jason
        Hi Brett I tried omnicppcomplete-0.41 as Dominique s setting, but it didn t work for me. Error message is Omni Completion (^O^N^P)* pattern not found** * I
        Message 3 of 10 , Oct 1, 2009
        • 0 Attachment
          Hi Brett
          I tried omnicppcomplete-0.41 as Dominique's setting,
          but it didn't work for me.
          Error message is "Omni Completion (^O^N^P) pattern not found"
          I tested it in the same file.
          I saw omnifunc=omni#cpp#complete#Main,
          which is from omnicppcomplet-0.4.1.
          I have no idea to get it solved.
          Thanks!
          B.R.

          2009/10/2 Brett Stahlman <brettstahlman@...>



          On Oct 1, 6:30 am, jason <beyond...@...> wrote:
          > Hi Dominique
          > I don't use omnicppcomplete-0.41, I use vim's default omnicomplete function.
          > These is my .vimrc setting about omnicomplete function:
          > set completeopt=menu,longest
          > set omnifunc=ccomplete#Complete
          > My vim version is 7.2.0 in Windows and 7.2.245 in Slackware 13.0.
          > Ctags is 5.7. I just run "ctags -R ." in working dir.
          > In your screenshot, you inserted a space before "sA.", which changed to
          > "pb-> sA.", not "pb->sA.".
          > My problem is that if I don't insert space before "sA.", just "pb->sA.",
          > then put cursor behind "sA.", press C-X C-O,
          > omnicomplete's completion information is members of struct tagBBB,
          > but not members of struct tagAAA.
          > Thanks!
          > B.R.

          Jason,
          I see the same behavior as you. In fact, you will see the same list of
          members even if you use aa or bb instead of sA. I haven't looked at it
          in detail, but a quick glance at the ccomplete.vim file leads me to
          suspect that it doesn't contain the recursive logic to traverse a
          sequence of nested structures. I believe that for a . or ->
          completion, it looks all the way back to the beginning of the WORD
          (unbroken sequence of non-whitespace, including . and ->) to determine
          the type whose members will be displayed in the popup. If you type...
             pb->aa.bb.cc.something_silly.<C-X><C-O>
          ...you will still see the members of BB in the popup; i.e., only the
          type of pb matters.

          As Dominique pointed out, omnicppcomplete doesn't suffer from this
          limitation, and it works for C and C++. Incidentally, does anyone know
          whether Vissale Neang still maintains the omnicppcomplete plugin? I
          haven't gotten responses to a post and a private email on several
          omnicppcomplete issues...

          Thanks,
          Brett Stahlman




          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---

        • Stahlman Family
          ... Jason, How did you build the tags file? Here s the sample command line shown in the omnicppcomplete help: ctags -R --c++-kinds=+p --fields=+iaS --extra=+q
          Message 4 of 10 , Oct 1, 2009
          • 0 Attachment
            jason wrote:
            > Hi Brett
            > I tried omnicppcomplete-0.41 as Dominique's setting,
            > but it didn't work for me.
            > Error message is "Omni Completion (^O^N^P)* pattern not found**"*
            > I tested it in the same file.
            > I saw omnifunc=omni#cpp#complete#Main,
            > which is from omnicppcomplet-0.4.1.
            > I have no idea to get it solved.
            > Thanks!
            > B.R.

            Jason,
            How did you build the tags file? Here's the sample command line shown in
            the omnicppcomplete help:

            ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .

            Brett S.

            >

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • jason
            Hi Brett I did it as you said. my test.c is in dir $HOME/test these is my steps: 1.cd ~/test 2.run command ctags -R --c++-kinds=+p --fields=+iaSn --extra=+q
            Message 5 of 10 , Oct 1, 2009
            • 0 Attachment
              Hi Brett
              I did it as you said.
              my test.c is in dir $HOME/test
              these is my steps:
              1.cd ~/test
              2.run command "ctags -R --c++-kinds=+p --fields=+iaSn --extra=+q ."
              3.run vim
              4.put cursor at the end of "pb->"
              5.press C-X C-O
              It shows "Omni Completion (^O^N^P)* pattern not found".
              Are these operations correctly?
              Thanks!
              B.R.

              2009/10/2 Stahlman Family <brettstahlman@...>



              jason wrote:
              > Hi Brett
              > I tried omnicppcomplete-0.41 as Dominique's setting,
              > but it didn't work for me.
              > Error message is "Omni Completion (^O^N^P)* pattern not found**"*
              > I tested it in the same file.
              > I saw omnifunc=omni#cpp#complete#Main,
              > which is from omnicppcomplet-0.4.1.
              > I have no idea to get it solved.
              > Thanks!
              > B.R.

              Jason,
              How did you build the tags file? Here's the sample command line shown in
              the omnicppcomplete help:

              ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .

              Brett S.

              >




              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_use" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---

            • John Beckett
              Please bottom post on this list. Quote a small (relevant) part of the message you are replying to, and put your text underneath. See
              Message 6 of 10 , Oct 1, 2009
              • 0 Attachment
                Please bottom post on this list. Quote a small (relevant) part
                of the message you are replying to, and put your text underneath.

                See
                http://groups.google.com/group/vim_use/web/vim-information


                --~--~---------~--~----~------------~-------~--~----~
                You received this message from the "vim_use" maillist.
                For more information, visit http://www.vim.org/maillist.php
                -~----------~----~----~----~------~----~------~--~---
              • Stahlman Family
                ... You need to change typedf to typedef in your source files. Neither C nor ctags recognizes the former spelling. Brett Stahlman
                Message 7 of 10 , Oct 2, 2009
                • 0 Attachment
                  jason wrote:
                  > Hi Brett
                  > I did it as you said.
                  > my test.c is in dir $HOME/test
                  > these is my steps:
                  > 1.cd ~/test
                  > 2.run command "ctags -R --c++-kinds=+p --fields=+iaSn --extra=+q ."
                  > 3.run vim
                  > 4.put cursor at the end of "pb->"
                  > 5.press C-X C-O
                  > It shows "Omni Completion (^O^N^P)* pattern not found".
                  > Are these operations correctly?
                  > Thanks!
                  > B.R.
                  >

                  You need to change typedf to typedef in your source files. Neither C nor
                  ctags recognizes the former spelling.

                  Brett Stahlman

                  --~--~---------~--~----~------------~-------~--~----~
                  You received this message from the "vim_use" maillist.
                  For more information, visit http://www.vim.org/maillist.php
                  -~----------~----~----~----~------~----~------~--~---
                • jason
                  Thank you very much! 2009/10/2 Stahlman Family ... --~--~---------~--~----~------------~-------~--~----~ You received this message
                  Message 8 of 10 , Oct 2, 2009
                  • 0 Attachment
                    Thank you very much!


                    2009/10/2 Stahlman Family <brettstahlman@...>

                    You need to change typedf to typedef in your source files. Neither C nor
                    ctags recognizes the former spelling.

                    Brett Stahlman




                    --~--~---------~--~----~------------~-------~--~----~
                    You received this message from the "vim_use" maillist.
                    For more information, visit http://www.vim.org/maillist.php
                    -~----------~----~----~----~------~----~------~--~---

                  Your message has been successfully submitted and would be delivered to recipients shortly.