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

Vim8 support using nvim-yarp and vim-hug-neovim-rpc #553

Merged
merged 21 commits into from
Oct 22, 2017
Merged

Vim8 support using nvim-yarp and vim-hug-neovim-rpc #553

merged 21 commits into from
Oct 22, 2017

Conversation

Shougo
Copy link
Owner

@Shougo Shougo commented Oct 15, 2017

I have added the test code for nvim-yarp.
But it is freezed. Why?

@roxma

More Vim8 testers are needed.
Especially, Windows users.

Fix #339

Requirements:

https://github.com/roxma/nvim-yarp

https://github.com/roxma/vim-hug-neovim-rpc For Vim8

@roxma
Copy link
Contributor

roxma commented Oct 15, 2017

Is there a minimal vimrc?

It works on my side with this vimrc

set nocompatible
syntax on
filetype plugin indent on
set encoding=utf-8 fileencodings=ucs-bom,utf-8,gbk,gb18030,latin1 termencoding=utf-8

call plug#begin(expand('<sfile>:h') . '/plugged-deoplete/')
Plug 'Shougo/deoplete.nvim'
Plug 'roxma/vim-hug-neovim-rpc'
Plug 'roxma/nvim-yarp'
call plug#end()

After starting neovim, type :call deoplete#enable()

Then the keyword completion is working.

I also need reproducing steps to start with.

@Shougo
Copy link
Owner Author

Shougo commented Oct 15, 2017

Please test yarp branch.
The keyword completion should not work.
Because I have disabled the initialization.

@roxma
Copy link
Contributor

roxma commented Oct 15, 2017

[roxma@roxma-pc deoplete.nvim]$ gs
On branch yarp
nothing to commit, working tree clean
[roxma@roxma-pc deoplete.nvim]$ git log
commit b10d6b30c6e7cdc665c420f453b7cc0118c55f32 (grafted, HEAD -> yarp, shougo/yarp, origin/yarp)
Author: Shougo Matsushita <Shougo.Matsu@gmail.com>
Date:   Sun Oct 15 12:14:07 2017 +0900

    Test

I'm sure I'm on yarp branch.

I have called :call deoplete#enable() manually

@roxma
Copy link
Contributor

roxma commented Oct 15, 2017

Sorry,

Just noticed that I'm on the wrong working directory. I'll test it again.

@roxma roxma mentioned this pull request Oct 15, 2017
@roxma
Copy link
Contributor

roxma commented Oct 15, 2017

Use this command for starting neovim, NVIM_PYTHON_LOG_FILE=nvim.log NVIM_PYTHON_LOG_LEVEL=DEBUG vim, it will generate log files for deoplete module, it's very helpful.

It works on my side after #554.

@Shougo
Copy link
Owner Author

Shougo commented Oct 15, 2017

I have merged your PR.

It seems works in the minimal vimrc.

@Shougo
Copy link
Owner Author

Shougo commented Oct 15, 2017

@roxma It does not work in Vim8. Can you test it?

@roxma
Copy link
Contributor

roxma commented Oct 15, 2017

This commit roxma@10b3b58 based on #554 woks on vim8

I cannot send a PR, since it requires manual merge with your latest commit.

@Shougo
Copy link
Owner Author

Shougo commented Oct 15, 2017

I have fixed the commit manually.
But it does not work for me in Vim8.

@Shougo
Copy link
Owner Author

Shougo commented Oct 15, 2017

neovim_rpc#serveraddr() seems works.

@roxma
Copy link
Contributor

roxma commented Oct 15, 2017

Could you test the exact commit of this fork roxma@10b3b58

I pulled your latest commit, but it does not work. It seems other part is not working.

@Shougo
Copy link
Owner Author

Shougo commented Oct 15, 2017

@roxma
I have get the following errors.

Error detected while processing function deoplete#enable[1]..deoplete#initialize[1]..deoplete#init#_initialize[9]..deoplete#init#_channel[9]..<SNR>26_notify[1]..1[4]..yarp#pyx#init[11]..yarp#_serveraddr[9]..neovim_rpc#serveraddr:
line    5:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'neovim_rpc_server'
line    6:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'neovim_rpc_server' is not defined
E858: Eval did not return a valid python object
line   11:
E475: Invalid argument:
line   17:
E906: not an open channel

@roxma
Copy link
Contributor

roxma commented Oct 15, 2017

vim-hug-neovim-rpc is not working

Update both yarp and vim-hug-neovim-rpc to the latest version

Then check the result of these commands

set pyxversion
python3 import neovim
python3 import neovim_rpc_server

python import neovim
python import neovim_rpc_server

echo neovim_rpc#serveraddr() 

@Shougo
Copy link
Owner Author

Shougo commented Oct 15, 2017

I have updated both.
But it does not work.

@roxma
Copy link
Contributor

roxma commented Oct 15, 2017

What's the results of those commands?

@Shougo
Copy link
Owner Author

Shougo commented Oct 15, 2017

python3 import neovim does not work.

Messages maintainer: Bram Moolenaar <Bram@vim.org>
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.6/site-packages/neovim/__init__.py", line 11, in <module>
    from .msgpack_rpc import (ErrorResponse, child_session, socket_session,
  File "/usr/lib/python3.6/site-packages/neovim/msgpack_rpc/__init__.py", line 10, in <module>
    from .session import ErrorResponse, Session
  File "/usr/lib/python3.6/site-packages/neovim/msgpack_rpc/session.py", line 7, in <module>
    import greenlet
ImportError: /usr/lib/python3.6/site-packages/greenlet.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PyExc_ValueError

@roxma
Copy link
Contributor

roxma commented Oct 15, 2017

If set pyxversion gets a 3, either make vim8 works with python3 import neovim or add set pyxversion=2 into your vimrc

With set pyxversion=2, you need to get :python import neovim work

@Shougo
Copy link
Owner Author

Shougo commented Oct 15, 2017

set pyxversion is 3, but it does not work...

@AlexMasterov
Copy link

@Shougo
I checked the Python $PATH using echo exepath('python3'), and he pointed to the third-party (msys2) python3 executable. This was fixed by specifying g:python3_host_prog. Now it seems to work for me.

@Shougo
Copy link
Owner Author

Shougo commented Oct 16, 2017

Thank you for your testing.
It seems vim-hug-neovim-rpc problem...

@Shougo
Copy link
Owner Author

Shougo commented Oct 16, 2017

I will add the problem in FAQ.

@tracyone
Copy link

macOS 10.13

vim version:8.0 1194

Work but it is a bit slow at startup.

Another problem is neovim. See following screenshot.

    Plug 'Shougo/deoplete.nvim'
    Plug 'zchee/deoplete-clang'
    if !te#env#IsNvim()
        Plug 'roxma/nvim-yarp'
        Plug 'roxma/vim-hug-neovim-rpc'
    endif

2017-10-16 21 04 27

@roxma
Copy link
Contributor

roxma commented Oct 16, 2017

@tracyone

Plug 'Shougo/deoplete.nvim'
Plug 'zchee/deoplete-clang'
Plug 'roxma/nvim-yarp'
if !te#env#IsNvim()
    Plug 'roxma/vim-hug-neovim-rpc'
endif

Move yarp out of the if block

@Shougo
Copy link
Owner Author

Shougo commented Oct 16, 2017

@tracyone Please read the error messages...

@Shougo
Copy link
Owner Author

Shougo commented Oct 16, 2017

I have added Python3 detection.

@markonm
Copy link

markonm commented Oct 18, 2017

@roxma
Is it necessary to have Plug 'roxma/vim-hug-neovim-rpc' inside if block? Isn't it loaded only on demand because it only contains autoload folder?

@Shougo
Copy link
Owner Author

Shougo commented Oct 18, 2017

@xtal8 vim-hug-neovim-rpc is needed for Vim.
nvim-yarp is needed for both Vim and neovim.

@wsdjeg
Copy link
Contributor

wsdjeg commented Oct 19, 2017

@Shougo IN old version, deoplete do not need vim-yarp by default in Neovim. I think we should keep this behavior!

many people use Neovim only. and some old user of deoplete do not install vim-yarp.

@Shougo
Copy link
Owner Author

Shougo commented Oct 19, 2017

@Shougo IN old version, deoplete do not need vim-yarp by default in Neovim. I think we should keep this behavior!

many people use Neovim only. and some old user of deoplete do not install vim-yarp.

Of course, I have thought the problem.
I don't like the dependency.

@Shougo
Copy link
Owner Author

Shougo commented Oct 19, 2017

But we have many :UpdateRemotePlugins issues.

https://github.com/Shougo/deoplete.nvim/issues?q=is%3Aissue+updateremoteplugins+is%3Aclosed

This is annoying.

@wsdjeg
Copy link
Contributor

wsdjeg commented Oct 19, 2017

@Shougo this kind issues should be fixed by neovim itself instead of plugin. I am not sure if there is any PR about it.

@Shougo
Copy link
Owner Author

Shougo commented Oct 19, 2017

And I don't want to keep neovim code and Vim8 code.

@Shougo this kind issues should be fixed by neovim itself instead of plugin. I am not sure if there is any PR about it.

Yes, and it is not fixed yet!

@wsdjeg
Copy link
Contributor

wsdjeg commented Oct 19, 2017

hmm. ok I got it.

@Shougo
Copy link
Owner Author

Shougo commented Oct 19, 2017

OK. I will consider the problem.

@Shougo
Copy link
Owner Author

Shougo commented Oct 19, 2017

The merge needs more time.
Please wait.

@Shougo
Copy link
Owner Author

Shougo commented Oct 21, 2017

I have fixed the compatibility problems.

@wsdjeg Please test it.

@Shougo Shougo merged commit 1f074c1 into master Oct 22, 2017
@Shougo Shougo deleted the yarp branch October 22, 2017 02:10
@Shougo
Copy link
Owner Author

Shougo commented Oct 22, 2017

Merged.

@wsdjeg
Copy link
Contributor

wsdjeg commented Oct 22, 2017

nice work!

@mreishus
Copy link

Great job. It's working for me in windows with vim 8.

Here are my notes on getting the python support in vim to work on windows if anyone googling finds this:

" 0. Install chocolately package manager.
" 1. If you installed vim on your own, uninstall it and run "choco install vim".
" 1.5.  The choco version of vim is installed with dynamic python support, so you only need to have a python35.dll in your path.  Note that later versions of the choco vim package may bump this to 3.6, and later steps will need to be modified.
" 2. choco install python3 --version 3.5.4
" 3. choco pin add -n=python3 --version 3.5.4
" 4. Add C:\python35 to path and run refreshenv in powershell
" 5. Copy C:\Python35\python.exe to C:\Python35\python3.exe 
" 6. C:\Python35\Scripts\pip.exe install neovim

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

Successfully merging this pull request may close these issues.

None yet

7 participants