在 Tagbar 中将 Python 变量显示为函数的子级(gVim,带有丰富的 ctags)
我正在尝试在 gVim 的 Tagbar 中显示函数内部的变量。目前,函数显示在类内部,变量显示在类内部,但变量不显示在函数内部。我希望能够看到每个函数内部使用了哪些变量。
我尝试在标签栏中使用“kind2scope”和“scope2kind”,但无济于事。我认为这可能需要编辑 Tagbar 和 ctags,但我可能是完全错误的。
我是 Python 新手,因此,代码可能非常糟糕。
这是标签栏当前的样子:
I am trying to show variables inside functions in Tagbar for gVim. Currently, functions are shown inside classes, and variables are shown inside classes, but variables are not shown inside functions. I would like to be able to see which variables are used inside each function.
I have tried messing around with 'kind2scope' and 'scope2kind' in Tagbar, to no avail. I think this may require editing both Tagbar and ctags, but I could be [am probably] completely wrong.
I am new to Python, and as such, the code is probably pretty nasty.
This is what Tagbar currently looks like:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是 Exuberant Ctags 的一个(可能是有意的)限制,即不以任何语言显示局部变量。如果在 ctags 中实现了这一点,那么调整 Tagbar 以利用它就很简单了——根据具体的实现,Tagbar 可能根本不需要任何更改。但它肯定需要 ctags 的支持才能正常工作。
This is a (maybe intentional) limitation of Exuberant Ctags to not show local variables in any language. If that got implemented in ctags it would be trivial to adjust Tagbar to make use of it -- depending on the exact implementation Tagbar would potentially not need any changes at all. But it would definitely need support in ctags in order to work at all.