liuchengxu / vista.vim

:cactus: Viewer & Finder for LSP symbols and tags
https://liuchengxu.github.io/vista.vim
MIT License
1.88k stars 89 forks source link

Tree view for ctags #462

Closed jiangyinzuo closed 8 months ago

jiangyinzuo commented 1 year ago

Is your feature request related to a problem? Please describe.

The tagbar.vim plugin supports parsing ctags and provides a tree view functionality.

image

In vista.vim, we can also obtain a tree view using LSP (such as :Vista coc).

image

Indeed, :Vista ctags provides a flat view rather than a tree view.

image

So is it possible to support tree view for :Vista ctags

Describe the solution you'd like

Perhaps we can utilize the fields in the ctags file format to obtain the tree view.

a   foo.cpp /^  int a = 1;$/;"  v   namespace:foo::bar::baz1::baz2  typeref:typename:int
bar foo.cpp /^namespace foo::bar {$/;"  n   namespace:foo   file:
bar foo.cpp /^namespace foo::bar::baz3 { }$/;"  n   namespace:foo   file:
baz1    foo.cpp /^  namespace baz1::baz2 {$/;"  n   namespace:foo::bar  file:
baz2    foo.cpp /^  namespace baz1::baz2 {$/;"  n   namespace:foo::bar::baz1    file:
baz3    foo.cpp /^namespace foo::bar::baz3 { }$/;"  n   namespace:foo::bar  file:
foo foo.cpp /^namespace foo::bar {$/;"  n   file:
foo foo.cpp /^namespace foo::bar::baz3 { }$/;"  n   file:
zz  foo.cpp /^  void zz() {}$/;"    f   namespace:foo::bar::baz1::baz2  typeref:typename:void
liuchengxu commented 8 months ago

The tree view is already supported by :Vista ctags, there is some space for improvement though (https://github.com/liuchengxu/vista.vim/issues/320).