davidhalter / jedi-vim

Using the jedi autocompletion library for VIM.
MIT License
5.28k stars 370 forks source link

Cannot use jedi-vim on python functions etc. defined in egg files that are defined on sys.path #743

Closed cboddy closed 3 years ago

cboddy commented 7 years ago

Issue

When using jedi-vim with and a virtualenv, packages defined in egg files on sys.path are not available in jedi-vim functions like goto-definition. If I inflate the egg to the local-filesystem and add that directory to the sys.path instead of the egg then the package contents become available via jedi-vim functions and all is well, just not when they are added as .egg files to sys.path.

AFAIK this is supported?

Steps to reproduce

Take an egg file, add it to python-path (or sys.path from within .vimrc).

Output of “:verbose JediDebugInfo”

Using Python version: 2
 - sys.version: 2.7.5 (default, Nov  6 2016, 00:28:07), [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)]
 - site module: /usr/lib64/python2.7/site.pyc
Jedi path: /users/is/cboddy/.vim/bundle/jedi-vim/jedi/jedi/__init__.pyc
Jedi version: 0.9.0
jedi-vim git version: Unknown option: -C
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]
jedi git submodule status: Unknown option: -C
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]
:version

:version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Dec 21 2016 17:00:20)
Included patches: 1-160
Modified by <bugzilla@redhat.com>
Compiled by <bugzilla@redhat.com>
Huge version without GUI.  Features included (+) or not (-):
+acl             +cmdline_compl   +diff            +find_in_path    +keymap          +modify_fname    +mouse_xterm     +profile         -sniff           +termresponse    +vreplace        -xterm_save
+arabic          +cmdline_hist    +digraphs        +float           +langmap         +mouse           +multi_byte      +python/dyn      +startuptime     +textobjects     +wildignore      -xpm
+autocmd         +cmdline_info    -dnd             +folding         +libcall         -mouseshape      +multi_lang      -python3         +statusline      +title           +wildmenu
-balloon_eval    +comments        -ebcdic          -footer          +linebreak       +mouse_dec       -mzscheme        +quickfix        -sun_workshop    -toolbar         +windows
-browse          +conceal         +emacs_tags      +fork()          +lispindent      +mouse_gpm       +netbeans_intg   +reltime         +syntax          +user_commands   +writebackup
++builtin_terms  +cryptv          +eval            +gettext         +listcmds        -mouse_jsbterm   +path_extra      +rightleft       +tag_binary      +vertsplit       -X11
+byte_offset     +cscope          +ex_extra        -hangul_input    +localmap        +mouse_netterm   +perl            +ruby/dyn        +tag_old_static  +virtualedit     -xfontset
+cindent         +cursorbind      +extra_search    +iconv           -lua             +mouse_sgr       +persistent_undo +scrollbind      -tag_any_white   +visual          -xim
-clientserver    +cursorshape     +farsi           +insert_expand   +menu            -mouse_sysmouse  +postscript      +signs           -tcl             +visualextra     -xsmp
-clipboard       +dialog_con      +file_in_path    +jumplist        +mksession       +mouse_urxvt     +printer         +smartindent     +terminfo        +viminfo         -xterm_clipboard
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/etc"
 f-b for $VIMRUNTIME: "/usr/share/vim/vim74"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -O2 -g -pipe -Wall -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BI
TS=64 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -L. -Wl,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,--enable-new-dtags -Wl,-rpath,/usr/lib64/perl5/CORE  -Wl,-z,relro  -L/usr/local/lib -Wl,--as-needed -o vim        -lm -lnsl  -
lselinux  -lncurses -lacl -lattr -lgpm -ldl   -Wl,--enable-new-dtags -Wl,-rpath,/usr/lib64/perl5/CORE  -fstack-protector  -L/usr/lib64/perl5/CORE -lperl -lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc

ps

Thanks for such a useful and clearly written project, I use it every day!

cboddy commented 6 years ago

Hi, any update on this? If viewing files from eggs on the python-path is not already a feature, I'd be able to spend some time on it if you had any ideas on how it might be done.

davidhalter commented 6 years ago

Sorry, this issue is probably still open in one of my thousand open tabs :)

I'm not really an expert on eggs. I'm trying to understand how jedi would actually complete them but I'm not sure at all.

davidhalter commented 3 years ago

I'm not sure if it supported now, but I feel like if it isn't, it probably never will be. I'm not interested in support obscure Python features that less than 0.1% of Python developers use (mostly working in a company on legacy code).