vim-rtags icon indicating copy to clipboard operation
vim-rtags copied to clipboard

Undefined variable "ch" with latest vim-rtags

Open rajukv opened this issue 7 years ago • 10 comments

Using latest vim-rtags with vim 7.4.1689(Ubuntu 16.04 default), I get the following errors when I try to "FindRefs" or "JumpTo"(pretty much every command throws a similar error).

Error detected while processing function rtags#JumpTo[7]..rtags#ExecuteThen[2]..rtags#ExecuteRCAsync: line 41: E121: Undefined variable: ch E15: Invalid expression: {ch, data -> rtags#HandleResults(ch_info(ch).id, data, 'vim_stdout')} line 42: E121: Undefined variable: ch E15: Invalid expression: {ch, data -> rtags#HandleResults(ch_info(ch).id, data,'vim_exit')}

rajukv avatar Jul 10 '17 13:07 rajukv

It is strange how it actually got past those checks for job/channel which are not supposed to be available for vim 7.4. Which git commit are you on? I tried using vim 7.4 and got a different error. 054cd89 should fix for the error I got on my old version of vim. Could you give a try and let us know if that works for you?

lyuts avatar Jul 11 '17 05:07 lyuts

I am on c6dcdd4f67484f3e1e94a06a2f56012449fd5528

rajukv avatar Jul 11 '17 05:07 rajukv

I pulled your commit 054cd8970eda8e222fc5b4c7b88d2a8727d34f25, but I am still hitting the issue. I dont have any problems with neovim though

rajukv avatar Jul 11 '17 05:07 rajukv

I have the same issue on my Ubuntu 16.04 with: VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 16:44:48) Included patches: 1-1689 Extra patches: 8.0.0056

kurdybacha avatar Jul 18 '17 16:07 kurdybacha

Same issue with Linux Mint 18.1 with the same vim version as @kurdybacha. Updating to vim 8.0 fixed all the issues. It seems that it's just vim 7.4 that the plugin has trouble with. I am new to rtags so I can't comment about much more than that.

samaursa avatar Aug 05 '17 03:08 samaursa

I think this link might shed some light on this issue: https://www.reddit.com/r/vim/comments/44qgn0/vim_patch_741274_adds_job_functionality_not/

On Ubuntu 16.04 ViM 7.4-1689 returns true for both the job and channel features, as they are both technically there, although I imagine they are not fully compatible with the API implemented in ViM 8.0...

Might I suggest adding a version check to avoid this problem on older versions of ViM.

therivenman avatar Aug 14 '17 21:08 therivenman

Same issue on commit fbfa692. Any improvement on the matter?

guigui64 avatar Feb 23 '18 12:02 guigui64

same problem here.

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 16:44:48)
Included patches: 1-1689
Extra patches: 8.0.0056

4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

extr15 avatar Mar 05 '18 12:03 extr15

Same here: Plugin commit id: fbfa69264cb0283bf00e60f860566ac33943e24a

Vim version: VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Mar 7 2018 10:50:27) Included patches: 1-1587

For vim I tried two configurations: one built with python2 and the other with python3 support.

svuolli avatar Mar 07 '18 11:03 svuolli

I got this problem when using

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 16:44:48)
Included patches: 1-1689
Extra patches: 8.0.0056

btw this is the newest VIM in Ubuntu 16.04 package repository.

Problem solved by updating VIM to 8.0. For Ubuntu users: http://tipsonubuntu.com/2016/09/13/vim-8-0-released-install-ubuntu-16-04/

The implementation of ExecuteRCAsync uses lambda expression which I think is a feature from VIM8.0. No matter if it is using channel/job or not, I would upvote to add a version check as @therivenman has suggested.

KavenC avatar Mar 20 '18 07:03 KavenC