deoplete-plugins / deoplete-jedi

deoplete.nvim source for Python
MIT License
588 stars 40 forks source link

deoplete-jedi can not provide auto-complete for some modules but jedi-vim can for the same module #225

Closed jdhao closed 4 years ago

jdhao commented 5 years ago

Problem summary

I found that for the package torchvision, auto-completion of method or class does not work for the modules inside this package.

But if I use jedi-vim for auto-completion, the auto-completion menu shows upon pressing ..

Expected

Auto-completion works for this package just like jedi-vim since they use the same underlying package Jedi.

Environment Information

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

" Use the following as a template.
set runtimepath+=/home/haojiedong/.local/share/nvim/plugged/deoplete.nvim/
set runtimepath+=/home/haojiedong/.local/share/nvim/plugged/deoplete-jedi/
let g:deoplete#enable_at_startup = 1
call deoplete#custom#source('jedi', 'is_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.

deoplete.log

Steps to reproduce the issue after starting Neovim (required)

  1. open a Python source file test.py, with the following content

    from torchvision import models, datasets, transforms
  2. start a new line and type models. or datasets. or transforms.

  3. the auto-completion menu is not shown

But if I use the following minimal config instead

set runtimepath+=/home/haojiedong/.local/share/nvim/plugged/jedi-vim
let g:jedi#completions_enabled = 1

I can use auto-completion for the same test.py when I type models. or datasets. or transforms..

Note that deoplete-jedi does work for other packages such os. For example, for

from os import path

if I type path., the deoplete autocompletion menu will show up.

image

I do not know if this problem is caused by this specific package or due to deoplete-jedi. But since jedi-vim can show the auto-complete correctly and both jedi-vim and deoplete-jedi use the same underlying Jedi package, I think there may be something not working properly with deoplete-jedi.

Screen shot (if possible)

The completeion menu using jedi-vim

image

Shougo commented 4 years ago

It is fixed on the latest.