deoplete-jedi: Jedi doesn't trigger on `from X import Y` reliably

Problem summary

When editing a Python file and typing from X import (where X is some module), Deoplete offers no jedi completions for the object Y being imported from module X.

Expected

Typing from X import | (where | is the cursor) should offer completions for objects inside module X at |.

Environment Information

  • OS: Arch Linux
  • Neovim version: v0.2.0

Provide a minimal init.vim with less than 50 lines (required)

" Use the following as a template.
set runtimepath+=~/path/to/deoplete.nvim/
set runtimepath+=~/path/to/deoplete-jedi/
let g:deoplete#enable_at_startup = 1
call deoplete#custom#set('jedi', 'debug_enabled', 1)
call deoplete#enable_logging('DEBUG', '/tmp/deoplete.log')

Generate logfiles if appropriate

  1. export NVIM_PYTHON_LOG_FILE=/tmp/nvim-log
  2. export NVIM_PYTHON_LOG_LEVEL=DEBUG
  3. nvim -u minimal.vimrc

Then look at and attach the files /tmp/nvim-log_{PID} and /tmp/deoplete.log here.

Steps to reproduce the issue after starting Neovim (required)

  1. Open a Python file
  2. Type from multiprocessing import (or any other module instead of multiprocessing)
  3. Observe that Deoplete’s only completion is import
  4. Backspace to place the cursor as from multiprocessing import|
  5. Wait a few seconds
  6. Press space and note that Deoplete now correctly suggests completions from jedi

Screen shot (if possible)

Observed Behavior: jedi_completions

Expected Behavior (obtained via steps 4-6 in the above reproduction procedure): jedi_completions_expected

Upload the logfile(s)

deoplete.log.txt

Additional Notes

I considered that this could be happening because of the time required for jedi to gather candidates. This could still be the cause, but I think it isn’t likely to be because this behavior is consistently observed for even trivially small modules (i.e. not something huge like numpy).

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16 (2 by maintainers)

Most upvoted comments

OK. I will merge it.

@novelview9 Please test #130.

I agree, the fix is working perfectly. Thank you! Closing.

deoplete-jedi I’ve created this gif, just to clarify whats going on.