Giter VIP home page Giter VIP logo

Comments (15)

roxma avatar roxma commented on June 3, 2024 3

There's a daemon flag I missed to set for some of the threads.

I managed to fix this issue. It runs more smoothly now.

from nvim-completion-manager.

roxma avatar roxma commented on June 3, 2024 1

If the last two commands prints the wrong result, a workaround would be let g:python3_host_prog="python3"

from nvim-completion-manager.

roxma avatar roxma commented on June 3, 2024

two main causes:

  1. vim-hug-neovim-rpc uses multithread implementation. Vim has to wait for thread exit before shutdown, even if those are python daemon thread.
  2. The current version of NCM is using the classic multi-process architecture, it runs outside of vim process and it is started via the job_start function. However, the job_start method provided by vim8, unlike the jobstart in neovim, has no detach option available, which means vim8 has to wait for NCM process exit before shutdown.

I'll leave this issue open, and document this as known issue.

from nvim-completion-manager.

liuchengxu avatar liuchengxu commented on June 3, 2024

@roxma Thanks for your effort! But I run into an error in Vim8. Can you take a look at it?

ncm

Here is nvim.log_py3_cm_core

from nvim-completion-manager.

roxma avatar roxma commented on June 3, 2024

Is there a minimal vimrc as bellow so that I can start with:

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/')
Plug 'roxma/nvim-completion-manager'
if !has('nvim')
    Plug 'roxma/vim-hug-neovim-rpc'
endif
call plug#end()

Besides, It seems vim-hug-neovim-rpc is not working. In this case, use NVIM_PYTHON_LOG_FILE=nvim.log NVIM_PYTHON_LOG_LEVEL=DEBUG vim8 for starting vim8, to generate the log file nvim.log_py2_neovim_rpc_server

I've just fixed a python2 issue on vim-hug-neovim-rpc. Remember to update both plugin to the latest version before further testing.

from nvim-completion-manager.

liuchengxu avatar liuchengxu commented on June 3, 2024

The minimal 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('/tmp/plugged')
  Plug 'roxma/nvim-completion-manager'
  if !has('nvim')
    Plug 'roxma/vim-hug-neovim-rpc'
  endif
call plug#end()
$ export NVIM_PYTHON_LOG_FILE=nvim.log NVIM_PYTHON_LOG_LEVEL=DEBUG vim8
$ vim -U NONE -u vimrc

There are three logs generated(see here):

  • nvim.log_py3_cm_core
  • nvim.log_py3_neovim_rpc_server
  • nvim.log_py3_script

The error still persists in Vim8. NeoVim just works well.

from nvim-completion-manager.

roxma avatar roxma commented on June 3, 2024

I cannot reproduce it.

But notice that similar error could be triggered by tee | vim | tee

[roxma@roxma-pc ~]$ tee | /usr/bin/vim | tee                                                                                                                                                        
Vim: Warning: Output is not to a terminal                                                                                                                                                           
Vim: Warning: Input is not from a terminal                                                                                                                                                          

Maybe part of the plugin is trying to start vim.

In this case, try export NVIM_NCM_MULTI_THREAD=0

Enter vim8, wait for the error, do nothing, open another terminal, check the process tree with something like ps --forest

from nvim-completion-manager.

liuchengxu avatar liuchengxu commented on June 3, 2024

The issue doesn't show up by setting export NVIM_NCM_MULTI_THREAD=0, in which case, NCM works fine in Vim8 and the previous delay problem goes away too.

Is the issue above only related to my local environment from your point of view? Does NVIM_NCM_MULTI_THREAD=0 make a difference to the user experience?

from nvim-completion-manager.

roxma avatar roxma commented on June 3, 2024

The issue doesn't show up by setting export NVIM_NCM_MULTI_THREAD=0

I think it's printing internally, but the message fails to forward to NCM core and than forward to vim.

You could try inspect the process tree anyway.

Is the issue above only related to my local environment from your point of view?

I think it is.

Does NVIM_NCM_MULTI_THREAD=0 make a difference to the user experience?

Generally peaking, a user cannot feel the difference.

NVIM_NCM_MULTI_THREAD=1 means each source is running as a thread, this mode consumes less memory

NVIM_NCM_MULTI_THREAD=0 means each source is running as a process, this mode is easier for debugging.

from nvim-completion-manager.

liuchengxu avatar liuchengxu commented on June 3, 2024

Sorry, @roxma . Just realized that my last feedback (works in Vim8 using NVIM_NCM_MULTI_THREAD=0) was wrong πŸ™‰ . I forgot to use the minimal vimrc :(. The right one should be as follows:

$ export NVIM_NCM_MULTI_THREAD=0
$ vim -U NONE -u vimrc

2017-10-15 2 04 08

Any tips?

from nvim-completion-manager.

roxma avatar roxma commented on June 3, 2024

We're getting close, check the output of these commands

:python3 import sys
:python3 print(sys.executable)
:echo g:_cm_py3

from nvim-completion-manager.

liuchengxu avatar liuchengxu commented on June 3, 2024
:python3 import sys
:python3 print(sys.executable)
/usr/local/bin/vim
:echo g:_cm_py3
/usr/local/bin/vim

Not sure whether it's the wrong result, but Vim8 gets to work finally via let g:python3_host_prog="python3" in the minimal vimrc πŸŽ‰ .

from nvim-completion-manager.

liuchengxu avatar liuchengxu commented on June 3, 2024

For Vim 8:

  • roxma/vim-hug-neovim-rpc
  • g:python3_host_prog or python3 in your $PATH

I notice the requirement for Vim8 in README. I believe python3 has already been in $PATH in my case, but I still have to set g:python3_host_prog. So, may it's not complete to have only python3 in $PATH, or we could have a better instruction?

from nvim-completion-manager.

roxma avatar roxma commented on June 3, 2024

The requirements are updated after this issue is figured out.

Have you updated both plugins to the latest version?

from nvim-completion-manager.

liuchengxu avatar liuchengxu commented on June 3, 2024

With the latest version and :echo has('python3') not empty, there is no need to set g:python3_host_prog! πŸŽ‰

from nvim-completion-manager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.