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

could not open tags window in some cpp files #378

Open zombo opened 3 years ago

zombo commented 3 years ago

Describe the bug use the command :Vista!! or :Vista coc could not open tag window.

:Vista ctags could work.

you can find the bug using 123.cpp at the test directory

Environment:

Vista info

Current FileType: cpp

Avaliable Executives: ['ale', 'coc', 'ctags'] Global Variables: let g:vista = {'winnr': function('179'), 'tree': {}, 'source': {'fname': '123.cpp', 'bufnr': 40, 'get_winid': function('183'), 'winid': 1012, 'winnr': 2, 'extension': function('188'), 'line': function('186'), 'get_winnr': function('182'), 'filetype': function('184'), 'lines': function('185'), 'line_trimmed': function('187'), 'scope_seperator': function('189'), 'fpath': 'D:\software\Vim\vimfiles\bundle\vista.vim\test\data\123.cpp'}, 'without_scope': [{'file': v:true, 'name': 'NUM_POINTS', 'line': 23, '_type': 'tag', 'kind': 'macro'}, {'file': v:true, 'name': 'M_PI', 'line': 24, '_type': 'tag', 'kind': 'macro'}, {'file': v:true, 'name': 'REAL', 'line': 31, '_type': 'tag', 'kind': 'macro'}, {'file': v:true, 'name': 'IMAG', 'line': 32, '_type': 'tag', 'kind': 'macro'}, {'name': 'acquire_from_somewhere', 'line': 34, '_type': 'tag', 'kind': 'function', 'signature': '(fftw_complex signal)'}, {'name': 'do_something_with', 'line': 51, '_type': 'tag', 'kind': 'function', 'signature': '(fftw_complex result)'}, {'name': 'main', 'line': 65, '_type': 'tag', 'kind': 'function', 'signature': '()'}], 'lnum': 1, 'get_tagline_under_cursor': function('181'), 'provider': 'coc', 'with_scope': [], 'functions': [{'lnum': 34, 'col': 6, 'range': {'end': {'character': 1, 'line': 48}, 'start': {'character': 0, 'line': 33}}, 'selectionRange': {'end': {'character': 27, 'line': 33}, 'start': {'character': 5, 'line': 33}}, 'level': 0, 'kind': 'Function', 'text': 'acquire_from_somewhere'}, {'lnum': 51, 'col': 6, 'range': {'end': {'character': 1, 'line': 60}, 'start': {'character': 0, 'line': 50}}, 'selectionRange': {'end': {'character': 22, 'line': 50}, 'start': {'character': 5, 'line': 50}}, 'level': 0, 'kind': 'Function', 'text': 'do_something_with'}, {'lnum': 65, 'col': 5, 'range': {'end': {'character': 1, 'line': 79}, 'start': {'character': 0, 'line': 64}}, 'selectionRange': {'end': {'character': 8, 'line': 64}, 'start': {'character': 4, 'line': 64}}, 'level': 0, 'kind': 'Function', 'text': 'main'}], 'raw': [{'name': 'NUM_POINTS', 'vlnum': 8, 'line': 23, 'kind': 'Unknown'}, {'name': 'M_PI', 'vlnum': 9, 'line': 24, 'kind': 'Unknown'}, {'name': 'REAL', 'vlnum': 10, 'line': 31, 'kind': 'Unknown'}, {'name': 'IMAG', 'vlnum': 11, 'line': 32, 'kind': 'Unknown'}, {'name': 'acquire_from_somewhere', 'vlnum': 4, 'line': 34, 'kind': 'Function'}, {'name': 'do_something_with', 'vlnum': 5, 'line': 51, 'kind': 'Function'}, {'name': 'main', 'line': 65, 'kind': 'Function'}], 'kinds': ['macro', 'function'], 'vlnum_cache': [''], 'ctags_cmd': 'ctags --format=2 --excmd=pattern --fields=nksSaf --extras=+F --sort=no --append=no --language-force=c++ --c++-kinds=psvcdefghtmnu --output-format=json --fields=-PF -f- C:\Users\hp.cache\vista\d3ee3f494f77edb4a56265a2eec0332f2403f6a3f7ca7c39106a0d4c12efdc89.cpp', 'silent': v:false, 'bufnr': 44, 'raw_by_kind': {'function': [{'name': 'acquire_from_somewhere', 'line': 34, '_type': 'tag', 'kind': 'function', 'signature': '(fftw_complex signal)'}, {'name': 'do_something_with', 'line': 51, '_type': 'tag', 'kind': 'function', 'signature': '(fftw_complex result)'}, {'name': 'main', 'line': 65, '_type': 'tag', 'kind': 'function', 'signature': '()'}], 'macro': [{'file': v:true, 'name': 'NUM_POINTS', 'line': 23, '_type': 'tag', 'kind': 'macro'}, {'file': v:true, 'name': 'M_PI', 'line': 24, '_type': 'tag', 'kind': 'macro'}, {'file': v:true, 'name': 'REAL', 'line': 31, '_type': 'tag', 'kind': 'macro'}, {'file': v:true, 'name': 'IMAG', 'line': 32, '_type': 'tag', 'kind': 'macro'}]}, 'tmps': ['C:\Users\hp.cache\vista\3f73eeab0894584a257795af03411ea382768adead40a0230c348017de9b34dd.qf', 'C:\Users\hp.cache\vista\b9c4d37ce5de6886bb90e23c27552f3fdaa80168adf5b38edd1aaac596a23bde.cpp', 'C:\Users\hp.cache\vista\b9c4d37ce5de6886bb90e23c27552f3fdaa80168adf5b38edd1aaac596a23bde.cpp', 'C:\Users\hp.cache\vista\d3ee3f494f77edb4a56265a2eec0332f2403f6a3f7ca7c39106a0d4c12efdc89.cpp', 'C:\Users\hp.cache\vista\e37c23f63c1420d4678e7fc751c0babbe646d835bb21bc5b739f7412d757f1d2.txt', 'C:\Users\hp.cache\vista\e37c23f63c1420d4678e7fc751c0babbe646d835bb21bc5b739f7412d757f1d2.txt', 'C:\Users\hp.cache\vista\d3ee3f494f77edb4a56265a2eec0332f2403f6a3f7ca7c39106a0d4c12efdc89.cpp', 'C:\Users\hp.cache\vista\d3ee3f494f77edb4a56265a2eec0332f2403f6a3f7ca7c39106a0d4c12efdc89.cpp', 'C:\Users\hp.cache\vista\d3ee3f494f77edb4a56265a2eec0332f2403f6a3f7ca7c39106a0d4c12efdc89.cpp', 'C:\Users\hp.cache\vista\d3ee3f494f77edb4a56265a2eec0332f2403f6a3f7ca7c39106a0d4c12efdc89.cpp'], 'pos': [{'lnum': 1, 'leftcol': 0, 'col': 0, 'topfill': 0, 'topline': 1, 'coladd': 0, 'skipcol': 0, 'curswant': 0}, 2, ':1resize 36|vert :1resize 139|:2resize 36|vert :2resize 30|'], 'popup_visible': v:false, 'floating_visible': v:false, 'vlnum2tagname': {'4': 'acquire_from_somewhere', '5': 'do_something_with', '11': 'IMAG', '8': 'NUM_POINTS', '9': 'M_PI', '10': 'REAL'}, 'winid': 1064} let g:vista#executive#ctags#support_json_format = 1 let g:vista#executives = ['ale', 'coc', 'ctags', 'lcn', 'nvim_lsp', 'vim_lsc', 'vim_lsp'] let g:vista#extensions = ['markdown', 'rst'] let g:vista#finders = ['clap', 'fzf', 'skim'] let g:vista#renderer#ctags = 'default' let g:vista#renderer#default#vlnum_offset = 3 let g:vista#renderer#enable_icon = 1 let g:vista#renderer#icons = {'subroutine': '羚', 'method': '', 'func': '', 'variables': '', 'constructor': '略', 'field': '', 'interface': '', 'type': '', 'packages': '', 'property': '襁', 'implementation': '', 'default': '', 'augroup': 'פּ', 'macro': '', 'enumerator': '', 'const': '', 'macros': '', 'map': 'פּ', 'fields': '', 'functions': '', 'enum': '', 'function': '', 'target': '', 'typedef': '', 'namespace': '', 'enummember': '', 'variable': '', 'modules': '', 'constant': '', 'struct': '', 'types': '', 'module': '', 'typeParameter': '', 'package': '', 'class': '', 'member': '', 'var': '', 'union': '鬒'} let g:vista_blink = [2, 100] let g:vista_close_on_jump = 0 let g:vista_cursor_delay = 400 let g:vista_default_executive = 'ctags' let g:vista_disable_statusline = 1 let g:vista_echo_cursor = 1 let g:vista_enable_centering_jump = 1 let g:vista_executive_for = {'go': 'coc', 'java': 'coc', 'cpp': 'coc', 'rust': 'coc'} let g:vista_find_absolute_nearest_method_or_function = 0 let g:vista_find_nearest_method_or_function_delay = 300 let g:vista_fold_toggle_icons = ['▼', '▶'] let g:vista_fzf_preview = ['right:50%'] let g:vista_icon_indent = ['└ ', '│ '] let g:vista_ignore_kinds = [] let g:vista_no_mappings = 0 let g:vista_sidebar_position = 'vertical botright' let g:vista_sidebar_width = 30 let g:vista_stay_on_open = 1 let g:vista_top_level_blink = [2, 100] let g:vista_update_on_text_changed = 0 let g:vista_update_on_text_changed_delay = 500

Steps to reproduce given the above info

source file for reproduce the ctags issue:

minimal vimrc (neccessary when this issue is about some Vim LSP client):

set nocompatible
set runtimepath^=/path/to/vista.vim
syntax on
filetype plugin indent on

1. 2. 3. 4.

Expected behavior A clear and concise description of what you expected to happen.

Actual behavior A clear and concise description of what actually happens.

Screenshot or gif (if possible) If applicable, add screenshots to help explain your problem.