Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

Undefined variable "ch" with latest vim-rtags #76

Open
rajukv opened this issue Jul 10, 2017 · 10 comments
Open

Undefined variable "ch" with latest vim-rtags #76

rajukv opened this issue Jul 10, 2017 · 10 comments

Comments

@rajukv
Copy link
Contributor

rajukv commented Jul 10, 2017

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')}

@lyuts
Copy link
Owner

lyuts commented Jul 11, 2017

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?

@rajukv
Copy link
Contributor Author

rajukv commented Jul 11, 2017

I am on c6dcdd4

@rajukv
Copy link
Contributor Author

rajukv commented Jul 11, 2017

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

@kurdybacha
Copy link

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

fongwh1 added a commit to fongwh1/vimrc that referenced this issue Jul 30, 2017
    let l:opts.out_cb = {ch, data -> rtags#HandleResults(ch_info(ch).id, data, 'vim_stdout')}
    'ch' undefined; should change this to a function defintion

this has been reported:
    lyuts/vim-rtags#76
@samaursa
Copy link

samaursa commented Aug 5, 2017

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.

therivenman pushed a commit to therivenman/vim-rtags that referenced this issue Aug 14, 2017
* This feature doesn't work correctly on older versions of ViM that support
  jobs and channels.

  lyuts#76
@therivenman
Copy link

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.

@guigui64
Copy link

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

@extr15
Copy link

extr15 commented Mar 5, 2018

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

@svuolli
Copy link

svuolli commented Mar 7, 2018

Same here:
Plugin commit id:
fbfa692

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.

@KavenC
Copy link

KavenC commented Mar 20, 2018

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants