-
-
Notifications
You must be signed in to change notification settings - Fork 372
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
[RFC] split jedi into external process #507
Conversation
Previously, jedi.vim load jedi module with vim's python interpreter, which restrict module explore path only from that python interpreter and virtualenvs created for that interpreter. This commit split jedi loading process into external process and make jedi.vim communicate the process through pipes. Because any python interpreter can execute this external process, user can freely choose which python interpreter to use.
Thanks so much mate! I'm not 100% sure yet what I think about it, but what do you think about davidhalter/jedi#385? Which would generalize this for all kinds of Jedi usages? |
I think this discussion forgot the case that user may install and use same python version on multiple places, but yes, it generalized (and complicated) version of mine. |
What do you mean by that?
Caching is an issue, but you wouldn't need to care about it, I could handle that. At the moment it's not handled anyway, so the server wouldn't even need to handle that in the beginning. Are you interested in creating a general async server for Jedi? If so one of the biggest issues is actually that sometimes you may want to not call certain methods, because performance would be improved. What would you think about that? Keeping a session? |
For example, User, who has /usr/bin/python2.7, also install python 2.7 under his home directory, say, /home/nakamuray/python27/bin/python2.7.
No. Async, multiple python version jedi server is beyond my needs. |
+1 |
open a new PR based on rpc2 branch. close it. |
Currently, jedi.vim load jedi module using vim's builtin python interpreter, which restrict module explore path only from that python interpreter and virtualenvs created for that interpreter.
So, for example, if I use vim linking with python 2.7 and working on virtualenv created for python 3.4, jedi.vim doesn't list completion candidates installed on the venv.
To fix the problem, I propose splitting jedi loading process into external process and make jedi.vim communicate it through pipes.
Because any python interpreter can execute this external process, user can freely choose which python interpreter to use and get expected completion results.
It assume that "python interpreter user expected" is a command executed as a "python" for now.
I tested this code on linux and osx.
It may cause some problems on windows environment. (cause I have no windows installation, I couldn't test it.)