Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E117: Unknown function: chansend #1999

Closed
noonien opened this issue Sep 25, 2018 · 18 comments
Closed

E117: Unknown function: chansend #1999

noonien opened this issue Sep 25, 2018 · 18 comments

Comments

@noonien
Copy link

noonien commented Sep 25, 2018

What did you do? (required. The issue will be closed when not provided.)

Browsed go code.

What did you expect to happen?

No errors.

What happened instead?

In a quickfix window:

Error detected while processing function <SNR>48_auto_type_info[3]..go#tool#Info[3]..go#complete#Info[2]..<SNR>104_async_info[58]..go#job#Start:                                                                           
line   41:
E117: Unknown function: chansend

Configuration (MUST fill this out):

  • vim-go version:
    master (5ec87ee)

  • Vim version (first three lines from :version):

NVIM v0.2.2
Build type: RelWithDebInfo
LuaJIT 2.0.4
  • Go version (go version):
    go version go1.11 linux/amd64

@

call chansend(job, l:input)

The go#Job#Start function calls chansend and chanclose, which i believe are depreacated functions, I believe it should be jobsend and jobclose instead.

@arp242
Copy link
Contributor

arp242 commented Sep 25, 2018

I think you got it reversed: chansend() is the new name added in 0.3.0, and jobsend() the old one; based on this.

So try updating Neovim?

@noonien
Copy link
Author

noonien commented Sep 25, 2018

Reply from neovim dev team: neovim/neovim#9051 (comment)

I'm using the latest stable neovim version.

@jamessan
Copy link

0.3.1 is the latest stable version, so you're a couple versions behind.

@noonien
Copy link
Author

noonien commented Sep 25, 2018

Hmm, interesting, it doesn't seem to have made its way into the neovim ubuntu ppa. Sorry for not checking that out.

Either way, from what I can tell from the neovim dev response, one should check if those functions exists before calling them.

Thanks, have a great day!

@jamessan
Copy link

However, I don't see a reason (off-hand) why the plugin should require using chansend(). It would be better to handle a broader range of nvim versions. For example:

let s:chansend = exists('*chansend') ? 'chansend' : 'jobsend'
let s:chanclose = exists('*chanclose') ? 'chanclose' : 'jobclose'
...
    if len(l:input) > 0
      call call(s:chansend, [job, l:input])
      " close stdin to signal that no more bytes will be sent.
      call call(s:chanclose, [job, 'stdin'])
    endif

@fatih
Copy link
Owner

fatih commented Sep 25, 2018

I agree, we should return an error. We already do it for several things. This is the second time an error is opened. I know we add the minimum version requirement to our README, but not many read it and it's easily skippable. We should let the user know that they need a never version of Nvim.

@jamessan
Copy link

We should let the user know that they need a never version of Nvim.

Why is 0.3.1 required?

@bfredl
Copy link

bfredl commented Sep 25, 2018

exists('*chansend') ? 'chansend' : 'jobsend'

There is no reason to do this, jobsend() continues to work on new versions. Just keep using jobsend() and jobclose() if the aim is so support older versions.

@bhcleek
Copy link
Collaborator

bhcleek commented Sep 25, 2018

The aim is not to support older versions. Neovim is not making any guarantees about backward compatibility, and it's still pre-1.0.

@bhcleek
Copy link
Collaborator

bhcleek commented Sep 25, 2018

Vim has v:version, but Neovim doesn't seem to update it correctly. Is there any easy way to get the version of Neovim besides parsing the output of :version?

@bfredl
Copy link

bfredl commented Sep 25, 2018

v:version still means vim version, otherwise would break a lot of plugins. api_info().version is neovim version.

@jamessan
Copy link

Neovim is not making any guarantees about backward compatibility

This isn't true. We've documented our compatibility requirements. There shouldn't be compatibility breaks from release to release (although APIs are subject to change during development cycles).

As @bfredl pointed out, the legacy names jobsend/jobclose have been kept explicitly to avoid breaking code.

@bhcleek
Copy link
Collaborator

bhcleek commented Sep 25, 2018

How long will they be kept?

@jamessan
Copy link

We follow semantic versioning, so not until 1.x could we break an API.

@bhcleek
Copy link
Collaborator

bhcleek commented Sep 25, 2018

Generally, pre-1.0 releases can break compatibility in semantic versioning. Can you point me to Neovim's documented api backward compatibility policy?

@jamessan
Copy link

https://neovim.io/doc/user/api.html#api-contract

@bhcleek
Copy link
Collaborator

bhcleek commented Sep 26, 2018

Thanks @jamessan ! I'll see if we have anything in vim-go now or (or coming up, because I'm working on some additional functionality) that requires 0.3.1.

@bhcleek
Copy link
Collaborator

bhcleek commented Sep 26, 2018

We've merged #2000 for now.

@bhcleek bhcleek closed this as completed Sep 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants