-
-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No tag representation for C++ using ctags #123
Comments
Use |
ok, I switched to ctags. In my *.cpp file I see only namespace but in *.hpp I see nothing but an error:
I use Universal Ctags
|
#82 seems to be related. |
Indeed, it solves the problem with header files. In the source file, I still see only the namespace definition but no error. |
Fill the full issue template please. |
Describe the bug When *.cpp file is opened, only namespace listed in the Vista window, Environment:
Features: +acl +iconv -jemalloc +tui system vimrc file: "$VIM/sysinit.vim"
Steps to reproduce given the above info
Actual behavior |
I realize that this issue may not be easy to fix since the current strategy used in https://github.com/liuchengxu/vista.vim/blob/master/autoload/vista/renderer/default.vim is unable to handle such a case. This needs some time to resolve. |
Same. @liuchengxu, what seems to be the problem (which part of renderer should be changed)? |
Check out |
@liuchengxu, at least comparing
|
@heroin-moose Feel free to send a PR to fix it. I'm currently working on another unpublished plugin in my free time.(P.S. I'm very happy with this new plugin, with |
@liuchengxu, that's not all. I believe that RealParentOf needs some tweaks too. P.S. Is this new plugin a replacement for Vista? |
Nope. I would say it a modern generic interactive finder and dispatcher which is able to find or dispatch anything on the fly, could be a replacement of ctrlp and other similar plugins, but in pure vimscript and the newly fancy |
Okay, there is one more catch. If you have no |
Sounds reasonable. Feel free to correct them. |
Actually, it's not that simple. At the very least it would require creating a tag that has no name (can be guessed in a language-specific way) and with no line/expr. And there are places in the code where tags are compared by line numbers. |
Well... it would be great to remove these line number checks because Vista can't handle this kind of code:
Tagbar can. |
Just do it :(, i'll review when you send a PR. |
After some poking around I came to a conclusion that Vista has wrong data model for tags. Tagbar, for example, uses tree-like structure that allows strong bond between a parent and children. Vista, on the other hand, uses list and relies on searching descendants during the rendering phase via This works well until it does not. Consider this case:
This may be not the best way to use namespaces but it does illustrate the problem. As you can see there are too identical namespaces, each one with it's own variable: Tagbar will handle this case correctly (at least tag-wise, since
There is a special function I suggest changing Vista's internal structure from a list to a tree before working on this issue. |
Yes, I also have a feeling that the strategy used in vista is unable to handle various corner cases after seeing these issues and the abortion of #142, but I currently don't have enough time to dive into this issue. If you are willing to help, feel free to revise any related part, I can provide the necessary assistance. |
@liuchengxu, since you've started CTags overhaul, I suggest adding this to the test suite:
The |
@heroin-moose Thanks for the test case. I haven't been working on #211 for a while as I don't know how to resolve the duplicated and psedu tag cases. Since I now mainly use vista for the data provider of my fuzzy finder instead of a tags structure explorer, and LSP can also have the tree view, I might not spend more time investigating the ctags tree view. Feel free to help if you are interested. |
Stale issue message |
Closing for #320 |
I started using Vista with coc as a replasemnt for tagbar. Everything looks good so far. My project is C++. In my Vista window, I have the following categories:
Method
Constructor
Namespace
Under the method category I have all my methods in the format:
namespace::class::method
IMHO, it would be more appropriate to have slighly different structure:
Namespace1
->Namespace2
-> Class
-> Method
The constructor and destructor should be grouped together or maybe not separated.
Let me know if you have any question.
The text was updated successfully, but these errors were encountered: