-
-
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
split jedi into external process, v2 #511
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.
|
||
This class provide jedi compatible API. | ||
''' | ||
python = 'python' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be made configurable in Vim?
May 'use_rpc'
could be changed to not use this RPC method when empty, but would otherwise be the path / command to use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, possible.
I'll do that.
Very interesting, thanks! How does it compare with regard to performance? |
Apparently, it has some performance penalty. It may be possible to get some speed by including known-to-be-used variables to the RemoteObject, which reduce RPC round trip.
It works on vim!!! ... In fact, there is not so much benefit over neovim's. If I had to say anything,
|
Thanks for all the work!! I think this is quite an ok solution. However I don't see what it actually improves besides calling arbitrary python versions (which is great!). What I would want for an async solution is an async server that is not living within jedi-vim. Such a server should be a part of Jedi! There's a good reason for it: This http server can be used for only within jedi-vim, while it could benefit a few other plugins as well. Hence once we're talking about a more general solution, we would need to talk about session handling (because some parts of the API are lazy). How do we keep that state? How do we do garbage collection on such sessions... etc. etc. In conclusion: I will not be merging this. It's just - not what we need in the long term. I might merge something that at least contains an async function that makes completion "faster". But I don't see big usage for this. BTW: JSON will not be the bottleneck at all. It's going to be Jedi itself. We don't have to pick a "fast" protocoll. Jedi is going to be literally a million times slower. Pickle might still be an option though (there are pickle versions aren't there? Or do they collide with python versions?) in case we have or even just pure http/rest. |
Yes, it only fix version problem, and it is very important for me.
No, it's not http server. It uses line based JSON protocol on a pipe.
Yes, state management is important. So, why do you stick to use HTTP, stateless procotol?
Sad. Then, I'll try implement it as a separate vim plugin, which override "jedi_vim.jedi" to RPC versioned one. Anyway, thanks to provide such a great tool! |
It's also not what I want. However, I want a long term solution not something that I have to maintain and throw away again.
True. But this is not the point. It's all about providing a good API on the side of Jedi to avoid everyone handling VIRTUALENV and different python versions separately.
That is true - I'm no expert in that area. I have just suggested HTTP, because it's used a lot at the moment, but a TCP socket would probably be way better. How do unix domain sockets and TCP sockets compare? Oh and for the experts: Is it possible to forward TCP sockets over SSH? |
It is second version of jedi RPC work. (v1, #507)
This time, RPC version of jedi object preserve original jedi compatible API.
I also added config option to toggle RPC code (disabled by default).