Skip to content
This repository has been archived by the owner on Jul 27, 2018. It is now read-only.

Trouble shooting

rox edited this page Oct 16, 2017 · 4 revisions

If something is broken when you play with NCM. Add something like this to your vimrc to generate log files.

	let $NVIM_PYTHON_LOG_FILE="/tmp/nvim_log"
        let $NVIM_NCM_LOG_LEVEL="DEBUG"
        let $NVIM_NCM_MULTI_THREAD=0

After you've reproduced the error, check the contents of the log files generated by NCM on current directory, especially nvim.log_py3_cm_core.

If no log file is generated, and you get the message nvim-completion-manager core channel terminated, then you have to try starting NCM manually, and see what's happaning. Follow these steps:

  1. If you are using vim-hug-neovim-rpc on vim8, use :echo neovim_rpc#serveraddr() to get the rpc server address. (eg. 127.0.0.1:37744).
  2. If you're on neovim, use :echo v:servername to get the rpc server address. (eg. /tmp/nvim5UoeSg/0)
  3. Find the pythonx/cm_start.py in NCM's installation directory, then you can start it manually.
# python3 pythonx/cm_start.py core {addr}
python3 pythonx/cm_start.py core /tmp/nvim5UoeSg/0

If NCM is working, but some completion source is broken. For example, python completion is not working, you need to check the contents of the file nvim.log_py3_cm_sources.cm_jedi. If this log file is not generated, the python completion source may have failed to start somehow. Follow these steps to start it manually:

  1. Find the rpc server address as before.
  2. Find the completion source name via :echo g:_cm_sources or simply :echo keys(g:_cm_sources). For python completion, It is cm-jedi, then use :echo g:_cm_sources['cm-jedi']['channel']['module'] to get the module name, which would be cm_sources.cm_jedi.
  3. Use the source name and the module name to start the source manually,
# python3 pythonx/cm_start.py channel {source_name} {module_name} {addr}
python3 pythonx/cm_start.py channel cm-jedi cm_sources.cm_jedi /tmp/nvim5UoeSg/0
Clone this wiki locally