Closed markwu closed 3 years ago
I tried coc, it has the same errors.
Can not reproduce. Use g:vista_log_file
(:h g:vista_log_file
), and add some debugging statements via vista#Debug(...)
to see what's going on,
Here comes the vista.log for Vista ctags
2021-02-16 01:08:36 ["executive::ctags::s:BuildCmd origin_fpath:/Users/markwu/Projects/vim-test/bundle/vista.vim/autoload/vista.vim"]
2021-02-16 01:08:36 ["executive::ctags::s:ApplyExecute calling s:RunAsyncCommon(ctags --format=2 --excmd=pattern --fields=nksSaf --extras=+F --sort=no --append=no --extras= --language-force=vim --vim-kinds=acfvmn --output-format=json --fields=-PF -f- /var/folders/y2/qvr3832j08340b8y6sbdv6dm0000gn/T/de6754042e7faa0d64c8cd91cf61a78d99c15e632b353d1d652ef2816966ab03.vim)"]
2021-02-16 01:08:36 ["executive::ctags::s:BuildCmd origin_fpath:/Users/markwu/Projects/vim-test/bundle/vista.vim/autoload/vista.vim"]
2021-02-16 01:08:36 ["executive::ctags::s:ApplyExecute calling s:RunAsyncCommon(ctags --format=2 --excmd=pattern --fields=nksSaf --extras=+F --sort=no --append=no --extras= --language-force=vim --vim-kinds=acfvmn --output-format=json --fields=-PF -f- /var/folders/y2/qvr3832j08340b8y6sbdv6dm0000gn/T/de6754042e7faa0d64c8cd91cf61a78d99c15e632b353d1d652ef2816966ab03.vim)"]
2021-02-16 01:08:36 ["executive::ctags::s:ApplyExtracted s:fpath:/Users/markwu/Projects/vim-test/bundle/vista.vim/autoload/vista.vim, s:reload_only:v:false, s:should_display:v:true"]
2021-02-16 01:08:36 ["[LSPProcess]should_display, processed_data:{'function': [{'lnum': 7, 'text': '', 'signature': '(dir)'}, {'lnum': 18, 'text': '', 'signature': '()'}, {'lnum': 25, 'text': '', 'signature': '(kind)'}, {'lnum': 29, 'text': '', 'signature': '(provider)'}, {'lnum': 38, 'text': '', 'signature': '(provider,AUF)'}, {'lnum': 44, 'text': '', 'signature': '()'}, {'lnum': 65, 'text': '', 'signature': '(Fn,Args)'}, {'lnum': 69, 'text': '', 'signature': '(filetype)'}, {'lnum': 81, 'text': '', 'signature': '()'}, {'lnum': 93, 'text': '', 'signature': '()'}, {'lnum': 110, 'text': '', 'signature': '()'}, {'lnum': 122, 'text': '', 'signature': '(...)'}, {'lnum': 128, 'text': '', 'signature': '(arg)'}, {'lnum': 160, 'text': '', 'signature': '(fst,snd)'}, {'lnum': 192, 'text': '', 'signature': '(bang,...)'}], 'variable': [{'lnum': 5, 'text': ''}, {'lnum': 11, 'text': ''}, {'lnum': 12, 'text': ''}, {'lnum': 13, 'text': ''}, {'lnum': 15, 'text': ''}, {'lnum': 31, 'text': ''}, {'lnum': 34, 'text': ''}, {'lnum': 46, 'text': ''}, {'lnum': 48, 'text': ''}, {'lnum': 120, 'text': ''}, {'lnum': 131, 'text': ''}, {'lnum': 149, 'text': ''}, {'lnum': 200, 'text': ''}, {'lnum': 209, 'text': ''}]}"]
2021-02-16 01:08:36 ["event.BufEnter",2,"/Users/markwu/Projects/vim-test/__vista__"]
2021-02-16 01:08:37 ["executive::ctags::s:ApplyExtracted s:fpath:/Users/markwu/Projects/vim-test/bundle/vista.vim/autoload/vista.vim, s:reload_only:v:false, s:should_display:v:true"]
2021-02-16 01:08:37 ["[LSPProcess]should_display, processed_data:{'function': [{'lnum': 7, 'text': '', 'signature': '(dir)'}, {'lnum': 18, 'text': '', 'signature': '()'}, {'lnum': 25, 'text': '', 'signature': '(kind)'}, {'lnum': 29, 'text': '', 'signature': '(provider)'}, {'lnum': 38, 'text': '', 'signature': '(provider,AUF)'}, {'lnum': 44, 'text': '', 'signature': '()'}, {'lnum': 65, 'text': '', 'signature': '(Fn,Args)'}, {'lnum': 69, 'text': '', 'signature': '(filetype)'}, {'lnum': 81, 'text': '', 'signature': '()'}, {'lnum': 93, 'text': '', 'signature': '()'}, {'lnum': 110, 'text': '', 'signature': '()'}, {'lnum': 122, 'text': '', 'signature': '(...)'}, {'lnum': 128, 'text': '', 'signature': '(arg)'}, {'lnum': 160, 'text': '', 'signature': '(fst,snd)'}, {'lnum': 192, 'text': '', 'signature': '(bang,...)'}], 'variable': [{'lnum': 5, 'text': ''}, {'lnum': 11, 'text': ''}, {'lnum': 12, 'text': ''}, {'lnum': 13, 'text': ''}, {'lnum': 15, 'text': ''}, {'lnum': 31, 'text': ''}, {'lnum': 34, 'text': ''}, {'lnum': 46, 'text': ''}, {'lnum': 48, 'text': ''}, {'lnum': 120, 'text': ''}, {'lnum': 131, 'text': ''}, {'lnum': 149, 'text': ''}, {'lnum': 200, 'text': ''}, {'lnum': 209, 'text': ''}]}"]
I think it might be universal-ctags change something, Vista ctags
works about one ago, but failed in recent commit. I can't tell which commit cause this.
I revert to the version about one years ago Universal Ctags 0.0.0(d22e13ef)
, it works.
Okay, I found it. It seems you didn't use the same universal-ctags version as mine to test, that's why you can not reproduce the bug.
After this commit https://github.com/universal-ctags/ctags/commit/c0421c5ec596b5f2a3e1a16a61d6ee3368a68842 in universal-ctags repository, Vista ctags
can't work anymore.
About the failed of Vista coc
, I have no idea at this moment.
@masatake The latest commit of u-ctags does not produce the name
field anymore using the following command, any insights?
$ ctags --format=2 --excmd=pattern --fields=nksSaf --extras=+F --sort=no --append=no --extras= --language-force=vim --vim-kinds=acfvmn --output-format=json --fields=-PF -f- autoload/vista.vim
# `name` field is missing
{"_type": "tag", "line": 5, "kind": "variable"}
......
I'm sorry. I changed.
Instead of --fields=nksSaf
you should use
A. --fields=+nksSaf
, or
B. --fields=NFPTtnksSaf
This means you should add optional fields you need to field enabled by default (A) or set all fields you need (B).
Both A and B must work with the latest u-ctags and relatively older u-ctags.
Thanks for the info @masatake, anything I can do in vista.vim to detect if the u-ctags is recent enough so that people using the older u-ctags won't complain?
Thanks for the info @masatake, anything I can do in vista.vim to detect if the u-ctags is recent enough so that people using the older u-ctags won't complain?
I don't find a good answer to the question.
How about ./configure
alike approach?
ctags --list-fields
. u-ctags --quiet --options=NONE --fields='NFPTtnksSaf' --_fatal-warnings /dev/null
Here NFPTtnksSaf
is the field list.
In step 2., u-ctags reports which field is not available to stderr.
You can send a pull request that includes test cases that verifies ctags behavior that vista.vim expects. u-ctags developers can know their changes breaking the interface before merging. I cannot promise u-ctags never breaks the interface, but I will notify the change.
Just tested --fields=+nksSaf
works with both the latest and the older version.
You can send a pull request that includes test cases that verifies ctags behavior that vista.vim expects.
I'm happy to do that, could you point out where should I add such a test? @masatake
I wrote an example test case for vista.vim
.
See https://github.com/masatake/ctags/commit/a7fe9f247094b092d838e9247f785d269216a9b6 at my repository.
It already works. You can extend the test case and/or add more test cases under Tmai.
See the commit log.
This is an interesting challenge for me to make an eco-system. I would like to apply this approach to other client tools. This is the first one. Inputs are welcome.
I'll look into that tomorrow :+1:, and happy to see vista.vim can be the first one of many in the future :(.
I confirm this issue fixed in commit https://github.com/liuchengxu/vista.vim/commit/cdccc4789e1a6f41a2688e58c051a2c00fcccd5f. Should I report Vista coc
in another issue? Or I can put it here?
Please file a new issue, looks like the response of coc.nvim's API changed.
Describe the bug
:Vista ctags
get an empty windows with errors.Environment:
Vista info
Steps to reproduce given the above info
**Steps and errors