Open bigardone opened 4 years ago
Check out :echo CocAction('documentSymbols')
when there is no symbols. If coc returns nothing, then it's not an issue of vista.vim.
Also try adding this for debugging, see if coc returns the symbols on that moment.
diff --git a/autoload/vista/executive/coc.vim b/autoload/vista/executive/coc.vim
index 8b36615..cd62e20 100644
--- a/autoload/vista/executive/coc.vim
+++ b/autoload/vista/executive/coc.vim
@@ -48,6 +48,7 @@ function! s:AutoUpdate(_fpath) abort
endfunction
function! s:Run() abort
+ echom 'coc symbols:'.string(CocAction('documentSymbols'))
return s:Extract(CocAction('documentSymbols'))
endfunction
Thanks for the response!
Opening a new file and running :echo CocAction('documentSymbols')
displays all the symbols:
However, clap/vista don't display any symbols:
However, doing it a second time, neither Coc or Clap/Vista no longer display any symbols:
If adding a blank line and saving, everything works as expected:
However, if I run :echo CocAction('documentSymbols')
, it does not list any symbols at all, which is very confusing.
vim-clap relys on vista.vim to fetch the symbols, and vista.vim actually uses the API of coc.nvim CocAction('documentSymbols')
. clap/vista.vim can do nothing if coc returns nothing.
What's more, I suggest you to setup ctags too, so that vista.vim can fallback to the ctags way, then you normally can get some tags response.
That makes sense. However, I'm going to open an issue in Coc reporting that CocAction('documentSymbols')
returns null until the file gets saved.
Thanks :)
Environment (please complete the following information):
Describe the bug When running
:Clap tags
after opening a file, the tags won't show in the popup until you save the buffer for the first time. If you open a different file and come back again to the first one, the same behavior happens and it does not show any tags until you save the buffer.Clap debug
To Reproduce Steps to reproduce the behavior:
min.vim
:Start (neo)vim with command:
vim -u min.vim
Open a file.
Type ':Clap tags'
Check that no symbols are listed in the popup.
Add a blank line to the file and save it.
Type ':Clap tags'.
Check that the symbols are listed correctly.
Open a different file in a different buffer.
Go back to the initial buffer.
Type ':Clap tags'
Check that no symbols are listed anymore.
Expected behavior Typing
:Clap tags
after opening a file should list symbols like Vista does, without having to previously save the file.Screenshots First time:
After saving the file:
After going to the next buffer and back:
Additional context
This week I reported this issue, https://github.com/liuchengxu/vista.vim/issues/234, could it be related?