deoplete-plugins / deoplete-jedi

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

Completion error when using gi.repository #227

Closed Jeansen closed 5 years ago

Jeansen commented 5 years ago

Problem summary

I've just started with python and Gtk. So I added the deoplete-jedi plugin and installed jedi.

Using the following code

import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk

win = Gtk.Window()
win.connect("destroy", Gtk.main_quit)
win.show_all()
Gtk.main()

I can successfully write Gtk. and get a long popupt. But when I write win. I get the following error:

`` [deoplete] Traceback (most recent call last):^@ File "/home/marcel/.vim/plugged/deoplete-jedi/rplugin/python3/deoplete/vendored/jedi/jedi/api/completion.py", line 43, in filter_names^@ k = (new.name, new.complete) # key^@ File "/home/marcel/.vim/plugged/deoplete-jedi/rplugin/python3/deoplete/vendored/jedi/jedi/a pi/classes.py", line 434, in complete^@ return self._complete(True)^@ File "/home/marcel/.vim/plugged/deoplete-jedi/rplugin/python3/deoplete/vendored/jedi/jedi/api/classes.py", line 403, in _complete^@ if self._name.api_type == 'param' and self._stack is not None:^@ File "/home/marcel/.vim/plugged/deoplete-jed i/rplugin/python3/deoplete/vendored/jedi/jedi/evaluate/compiled/context.py", line 237, in api_type^@ return next(iter(self.infer())).api_type^@StopIteration^@^@The above exception was the direct cause of the following exception:^@^@Traceback (most recent call last):^@ File "/home/marcel/.vim//plugged/deoplete.nvim /rplugin/python3/deoplete/child.py", line 182, in _gather_results^@ result = self._get_result(context, source)^@ File "/home/marcel/.vim//plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 241, in _get_result^@ ctx['candidates'] = source.gather_candidates(ctx)^@ File "/home/marcel/.vim/plugged/deop lete-jedi/rplugin/python3/deoplete/sources/deoplete_jedi/profiler.py", line 37, in wrapper^@ return func(self, *args, *kwargs)^@ File "/home/marcel/.vim//plugged/deoplete-jedi/rplugin/python3/deoplete/sources/deoplete_jedi.py", line 170, in gather_candidates^@ completions = self.get_completions(script)^@ File "/home/marcel/.vim/plugged/deoplete-jedi/rplugin/python3/deoplete/sources/deoplete_jedi/profiler.py", line 37, in wrapper^@ return func(self, args, **kwargs)^@ File "/home/marcel/.vim//plugged/deoplete-jedi/rplugin/python3/deoplete/sources/deoplete_jedi.py", line 123, in get_completions^@ return script.comple tions()^@ File "/home/marcel/.vim/plugged/deoplete-jedi/rplugin/python3/deoplete/vendored/jedi/jedi/api/init.py", line 179, in completions^@ completions = completion.completions()^@ File "/home/marcel/.vim/plugged/deoplete-jedi/rplugin/python3/deoplete/vendored/jedi/jedi/api/completion.py", line 103, in compl etions^@ return sorted(completions, key=lambda x: (x.name.startswith('__'),^@RuntimeError: generator raised StopIteration^@Error from jedi: generator raised StopIteration. Use :messages / see above for error details


## Expected

I would expect a long popup with all the available methods/properties for GtkWindow.

## Environment Information

 * OS: 
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"

 * Neovim version:
pynvim             0.3.2 
* Vim version

VIM - Vi IMproved 8.1 (2018 May 18, compiled Jun 07 2019 10:49:19) Included patches: 1-875, 878, 884, 948, 1046, 1365 Modified by team+vim@tracker.debian.org Compiled by team+vim@tracker.debian.org Huge version with GTK3 GUI. Features included (+) or not (-): +acl +extra_search +mouse_netterm +tag_old_static +arabic +farsi +mouse_sgr -tag_any_white +autocmd +file_in_path -mouse_sysmouse +tcl +autochdir +find_in_path +mouse_urxvt +termguicolors -autoservername +float +mouse_xterm +terminal +balloon_eval +folding +multi_byte +terminfo +balloon_eval_term -footer +multi_lang +termresponse +browse +fork() -mzscheme +textobjects ++builtin_terms +gettext +netbeans_intg +textprop +byte_offset -hangul_input +num64 +timers +channel +iconv +packages +title +cindent +insert_expand +path_extra +toolbar +clientserver +job +perl +user_commands +clipboard +jumplist +persistent_undo +vartabs +cmdline_compl +keymap +postscript +vertsplit +cmdline_hist +lambda +printer +virtualedit +cmdline_info +langmap +profile +visual +comments +libcall -python +visualextra +conceal +linebreak +python3 +viminfo +cryptv +lispindent +quickfix +vreplace +cscope +listcmds +reltime +wildignore +cursorbind +localmap +rightleft +wildmenu +cursorshape +lua +ruby +windows +dialog_con_gui +menu +scrollbind +writebackup +diff +mksession +signs +X11 +digraphs +modify_fname +smartindent -xfontset +dnd +mouse +startuptime +xim -ebcdic +mouseshape +statusline +xpm +emacs_tags +mouse_dec -sun_workshop +xsmp_interact +eval +mouse_gpm +syntax +xterm_clipboard +ex_extra -mouse_jsbterm +tag_binary -xterm_save

Shougo commented 5 years ago

It is jedi error instead of deoplete-jedi.

You can disable the error by g:deoplete#sources#jedi#ignore_errors.

Jeansen commented 5 years ago

@Shougo Thanks for the quick reply. That's what I was looking for but was not sure if it might be of interest. Closing this then.

Jeansen commented 5 years ago

@Shougo I am sorry, but it seems it is not an jedi issue. I opened an issue on the jedi side (https://github.com/davidhalter/jedi/issues/1345#issuecomment-506629188), but so far it seems jedi works fine. Especially with the latest version. And after I tried, waht was suggested by the author of jedi in his last comment, I can see no errors. In vim, they still persist :( Could you check or give me a hint what I can do to provide better debugging information?

Shougo commented 5 years ago

OK. Jedi's fix is not merged in deoplete-jedi. Please wait.

Shougo commented 5 years ago

Fixed.

Jeansen commented 5 years ago

@Shougo Great, works like a charm now :-) Thank you!