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

prototype to call jedi completion server in subprocess #624

Closed
wants to merge 1 commit into from

Conversation

dholth
Copy link

@dholth dholth commented Oct 1, 2016

Call jedi in a subprocess, executed with python on PATH.

This is a very messy prototype of calling Jedi in a subprocess, with less code running in the actual vim-embedded Python. PR for discussion only. I hope it is enough to demonstrate that doing a process split is not a big deal. Sorry that the vendored attrs library adds noise to the diff.

I wanted this to be able to use embedded-Python-3-only vim with Python 2 and importantly PyPy projects. I should probably just recompile vim myself, but I tried this.

The way it works is that jedi_client.py mocks the impressively small jedi API needed by jedi-vim. When you make a call it sends a line of JSON to the server, just a subprocess, which calls real jedi and writes a single line of JSON as the response. Just completions and signatures implemented so far.

If this was developed further then jedi-vim could stay the same, except that a configuration flag imports from jedi_client instead of jedi.

call jedi in a subprocess, executed with python on PATH.
@blueyed
Copy link
Collaborator

blueyed commented Oct 1, 2016

Thanks!

But as stated in #623 (comment) I consider this to be out of scope for this plugin, and would assume that @davidhalter thinks similar.
There are frameworks for doing more advanced completion (using a server architecture) already (deoplete and YouCompleteMe at least).

@dholth
Copy link
Author

dholth commented Oct 1, 2016

I do know about those other projects, particularly I'm a fan of YCM, but it had stopped working in my vim. The other option is switching to a different editor, probably a good idea, but not convenient.

Even when YCM is running it is still nice to be able to run a very simple (jedi-vim) plugin, especially for pypy, and to be able to have the few jedi-vim features that aren't in YCM.

This idea might have more in common with jedi (not jedi-vim) davidhalter/jedi#385 and make more sense there.

@davidhalter
Copy link
Owner

I agree with @blueyed here. There are other plugins that do this if you really need it now.

I think long-term a client/server architecture should be part of Jedi and not jedi-vim. So I'm closing this one. davidhalter/jedi#385

@davidhalter davidhalter closed this Oct 4, 2016
@davidhalter
Copy link
Owner

Thanks for your effort, though! I'm really not against these kind of big pull requests. It's just that the issue I mentioned (davidhalter/jedi#385) has been on my mind for a long time. I think we should really go with that.

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

Successfully merging this pull request may close these issues.

3 participants