1

Note this may be a duplicate, but I couldn't really find an answer.

From a C++ perspective:

With universal ctags on, doing a C-] on top of a method call presents you with a tag list matching the method name. Some of the methods in that list may be from different classes, some of them may be overloaded with either incompatible types or incorrect number of arguments compared to the original method.

Is there a plugin out there which removes some of the false positives or at the very least sorts this list in a smarter way? Something similar to what CLion cmake engine does?

I'm not interested in autocompletion as that works for me.

  • 2
    have you tried the taglist plugin? – Christian Brabandt Sep 12 at 8:47
  • 1
    @ChristianBrabandt I have looked at taglist, however I've settled with the tagbar plugin (an alternative to taglist) to provide me with an overview of the current file structure. – John Sep 12 at 9:17
  • 2
    Note there is the question Vim, ctags and overloading. Today a possible solution is to use a c++ language server and a vim lsp plugin. There is an answer from me describing vim-lsp together with clangd. – Hotschke Sep 12 at 13:36
6

I cannot provide an answer different to the one I gave in other similar questions.

While tag-based plugins may present a complete list of existing overloads in a way much more ergonomic than :tselect (they may even provide a filter option like my lh-tags plugin), they cannot help restrict the list of overloads to the one matching the types of the objects involved.

Well, they could. This would means they have parsed the current C++ code and built an associated AST. At this point, these plugins would have access to much better tools than tags, so they don't bother with tags. That's what language server protocol (LSP) plugins offer.

Lately, I've been using coc.nvim + ccls, the result is often much better that what I had with tag-based solutions to navigate C++ codes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.