-
Notifications
You must be signed in to change notification settings - Fork 49
Trouble shooting
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:
- 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
). - If you're on neovim, use
:echo v:servername
to get the rpc server address. (eg./tmp/nvim5UoeSg/0
) - 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:
- Find the rpc server address as before.
- Find the completion source name via
:echo g:_cm_sources
or simply:echo keys(g:_cm_sources)
. For python completion, It iscm-jedi
, then use:echo g:_cm_sources['cm-jedi']['channel']['module']
to get the module name, which would becm_sources.cm_jedi
. - 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