Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jedi 0.6 Version too old? #134

Closed
unboundval opened this issue May 17, 2013 · 14 comments
Closed

Jedi 0.6 Version too old? #134

unboundval opened this issue May 17, 2013 · 14 comments

Comments

@unboundval
Copy link

Hi!

I tried to install jedi and jedi-vim on gvim 7.3, however, whenever I open up a python file, the following errors comes up. The completion seems working properly but I am not sure these errors has any impact. I downloaded the plugin using Vundle and installed jedi 0.6 using pip.

I wonder whether anyone else encountered this problem? Thanks!

Please update your Jedi version, it is to old.
Error detected while processing /home/orbit0/docs/Dropbox/config/vimsuite/vim-linux/bundle/jedi-vim/after/syntax/python.vim:
line    1:
E121: Undefined variable: g:jedi#show_function_definition
E15: Invalid expression: g:jedi#show_function_definition == 1 && has('conceal')
Error detected while processing /home/orbit0/docs/Dropbox/config/vimsuite/vim-linux/bundle/jedi-vim/ftplugin/python/jedi.vim:
line   10:
E121: Undefined variable: g:jedi#auto_initialization
E15: Invalid expression: g:jedi#auto_initialization
line   34:
E121: Undefined variable: g:jedi#auto_vim_configuration
E15: Invalid expression: g:jedi#auto_vim_configuration
line   54:
E121: Undefined variable: g:jedi#auto_close_doc
E15: Invalid expression: g:jedi#auto_close_doc
@unboundval
Copy link
Author

After adding the followings to my .vimrc,

let g:jedi#auto_initialization = 1
let g:jedi#auto_vim_configuration = 1

The errors from ftplugin/python/jedi.vim are gone.

But other errors still persist.

@davidhalter
Copy link
Owner

I forgot to update the jedi sub repository in jedi-vim. That was the problem. Sorry for that. It should be fine now, please update jedi-vim and the sub-repositories.

@brownianwalker The way vundle works is that it checks out the repository and all sub repositories. This leaves the jedi pip version unused.

Are your commands above still relevant after this bug fix? I think you can just remove them.

@unboundval
Copy link
Author

Thank you for you prompt response. Unfortunately, it still does not work for me.

I tried to manually clone the repository, switch to dev branch and update its jedi submodules using the following commands, but the errors remain the same. Any idea?

orbit0@singularity ~/.vim/bundle $ rm jedi-vim/ -rf

orbit0@singularity ~/.vim/bundle $ git clone https://github.com/davidhalter/jedi-vim.git
orbit0@singularity ~/.vim/bundle $ cd jedi-vim/
orbit0@singularity ~/.vim/bundle/jedi-vim $ git checkout -b dev origin/dev

orbit0@singularity ~/.vim/bundle/jedi-vim $ git log -1
commit fcc8cf5185484e14faa81dfe3a3e8fb5d04541b2
Author: David Halter <davidhalter88@gmail.com>
Date:   Sat May 18 13:14:11 2013 +0430

    new jedi version also in sub repository

orbit0@singularity ~/.vim/bundle/jedi-vim $ git submodule update --init
orbit0@singularity ~/.vim/bundle/jedi-vim $ cd jedi
orbit0@singularity ~/.vim/bundle/jedi-vim/jedi $ python setup.py build

orbit0@singularity ~/.vim/bundle/jedi-vim/jedi $ gvim /tmp/test.py
Error detected while processing /home/orbit0/docs/Dropbox/config/vimsuite/vim-linux/bundle/jedi-vim/after/syntax/python.vim:
line    1:
E121: Undefined variable: g:jedi#show_function_definition
E15: Invalid expression: g:jedi#show_function_definition == 1 && has('conceal')
Error detected while processing /home/orbit0/docs/Dropbox/config/vimsuite/vim-linux/bundle/jedi-vim/ftplugin/python/jedi.vim:
line   14:
E121: Undefined variable: g:jedi#autocompletion_command
E15: Invalid expression: g:jedi#autocompletion_command == "<C-Space>"
line   41:
E121: Undefined variable: g:jedi#popup_on_dot
E15: Invalid expression: g:jedi#popup_on_dot
line   54:
E121: Undefined variable: g:jedi#auto_close_doc
E15: Invalid expression: g:jedi#auto_close_doc
orbit0@singularity ~/.vim/bundle/jedi-vim/jedi $ 

@davidhalter
Copy link
Owner

At least the Please update your Jedi version, it is to old. is gone now. That's what I fixed.

Can you tell me a little bit more about your operating system (distro, version) and tell me the output of :ver?

@unboundval
Copy link
Author

I am using Linux Mint 14, MATE 1.4.2. gvim 7.3. The ver output is as followings,

:ver
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 26 2012 16:45:32)
Included patches: 1-547
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by buildd@
Huge version with GTK2-GNOME GUI.  Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con_gui +diff +digraphs
+dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path
+find_in_path +float +folding -footer +fork() +gettext -hangul_input +iconv
+insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds
+localmap +lua +menu +mksession +modify_fname +mouse +mouseshape +mouse_dec
+mouse_gpm -mouse_jsbterm +mouse_netterm -mouse_sysmouse +mouse_xterm +mouse_urxvt
+multi_byte +multi_lang -mzscheme +netbeans_intg +path_extra +perl +persistent_undo
+postscript +printer +profile +python -python3 +quickfix +reltime +rightleft +ruby
+scrollbind +signs +smartindent -sniff +startuptime +statusline -sun_workshop
+syntax +tag_binary +tag_old_static -tag_any_white +tcl +terminfo +termresponse
+textobjects +title +toolbar +user_commands +vertsplit +virtualedit +visual
+visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup +X11
-xfontset +xim +xsmp_interact +xterm_clipboard -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc-4.6 -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/i
nclude/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/
usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/inclu
de/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12   -pthread
-DORBIT2=1 -D_REENTRANT -I/usr/include/libgnomeui-2.0 -I/usr/include/libart-2.0 -I/us
r/include/gconf/2 -I/usr/include/gnome-keyring-1 -I/usr/include/libgnome-2.0 -I/usr/i
nclude/libbonoboui-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gtk-2.0 -I/us
r/include/gdk-pixbuf-2.0 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/x86_64-linux-gnu/gno
me-vfs-2.0/include -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/inclu
de -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/includ
e/orbit-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/bonobo-activation-2.0 -I/usr/
include/libxml2 -I/usr/include/pango-1.0 -I/usr/include/gail-1.0 -I/usr/include/freet
ype2 -I/usr/include/atk-1.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/includ
e/cairo -I/usr/include/gio-unix-2.0/ -I/usr/include/pixman-1 -I/usr/include/libpng12
    -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-securi
ty -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1     -I/usr/include/tcl8.5  -D_REENTRANT=1  -
D_THREAD_SAFE=1  -D_LARGEFILE64_SOURCE=1
Linking: gcc-4.6   -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -rdynamic -Wl,-export-dy
namic  -Wl,-E  -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,--as-needed -o vim   -lgtk-x
11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf
-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0     -lgnome
ui-2 -lSM -lICE -lbonoboui-2 -lgnomevfs-2 -lgnomecanvas-2 -lgnome-2 -lpopt -lbonobo-2
 -lbonobo-activation -lORBit-2 -lart_lgpl_2 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lg
io-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetyp
e -lfontconfig -lgconf-2 -lgthread-2.0 -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0
-lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lnsl  -lselinux  -lacl -l
attr -lgpm -ldl  -L/usr/lib -llua5.1  -Wl,-E  -fstack-protector -L/usr/local/lib  -L/
usr/lib/perl/5.14/CORE -lperl -ldl -lm -lpthread -lcrypt -L/usr/lib/python2.7/config
-lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic
-functions  -L/usr/lib -ltcl8.5 -ldl -lpthread -lieee -lm -lruby-1.9.1 -lpthread -lrt
 -ldl -lcrypt -lm  -L/usr/lib

@davidhalter
Copy link
Owner

That is really strange! I have no idea what the problem could be. Basically it looks like the definitions in plugin/jedi.vim were never called. I have no idea why that wouldn't happen. Maybe someone else can help.

Of course you could always try to recompile and so on. But the version looks fine. Maybe you could also create a vim.log of the startup. I don't know how to do that anymore. But that could help.

@unboundval
Copy link
Author

I tried to install only jedi-vim without any other plugins, configuration options and bundle manager. It works properly. I thought it was due to my configuration. I disabled plugins and turned off the configuration options from my vimrc one by one and at last it turns out to be a configuration option I used to detect file type.

filetype detect

After removing this line, it works. As I am not familiar with the internals of vim, I am not sure how it is affecting the plugin. But at least it is working now.

Thank you for this awesome plugin and I am sorry that I should have verified the bug at the beginning.

@unboundval
Copy link
Author

After further testing, I found that removing "filetype detect" will make my other plugins failing to work properly.
I was using SuperTab+clang_complete to auto complete argument as discussed in ycm-core/YouCompleteMe#234, without this option, it stops working.

As I mentioned I am not familiar with vim internals, I am clueless about what is happening.

@davidhalter
Copy link
Owner

Strange. Maybe jedi-vim/YouCompleteMe don't play nice together? We are in the progress of making them play nicely together.

@unboundval
Copy link
Author

I am currently not using YouCompleteMe although I am exploring to replace my clang_complete with it. The link I referenced contains the setting to configure supertab and clang_complete for argument completion. So the error should not be related to YouCompleteMe.

@davidhalter
Copy link
Owner

I think I use filetype plugin on. Could you try that? But sometimes I find it very hard to understand the way VIM configurations work.. So I don't know if that helps.

@unboundval
Copy link
Author

I have both "filetype plugin" and "filetype detect" on. Anyway, thank you for your help.

@Valloric
Copy link

Just wanted to mention that YouCompleteMe and jedi-vim do not play nice together (YouCompleteMe and Jedi OTOH play very nice together; YCM uses Jedi as a git submodule). You'll have to pick one or the other; since YCM uses the same Jedi library as the semantic backend for Python, it's not really that much different. There are a few minor features present in jedi-vim that YCM currently does not have (see #119), but they will be added in the near future. Also, YCM has a ton of features not present in jedi-vim, so for now you'll have to pick which ones are more important to you.

@unboundval
Copy link
Author

I managed to solve the issue by moving the declaration of jedi-vim bundle after the "filetype detect", inside the python specific block of my vimrc. Just thought it might be useful if anyone else encountered the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants