Closed ikey4u closed 6 years ago
Do you have any opinions that could make Jedi knows the locals()?
There is no such thing as passing the locals to Jedi. Completions are missing from multiprocessing
because of a Jedi limitation. See https://github.com/davidhalter/jedi/issues/1094.
Why does the weird thing happen?
The change you made to the jedi_completer.py
file raises a syntax error (you should see the error in the output of :messages
). Because of that error, YCM is unable to provide native completion for Python and falls back to Vim's omnifunc which is returning those suggestions. In that particular case, Vim's omnifunc does a better job than Jedi. You should revert the change you made and wait for issue https://github.com/davidhalter/jedi/issues/1094 to be resolved.
Closing the issue as a Jedi limitation.
@micbou Many thanks for your kind and quick reply.
Reproduce the problem:
New a python3 file:
Since python3's multiprocessing is based on python2's threading libs, the
__init__.py
for python3 multiprocessing has no function or class declaration. As a result, YCM cannot detect the completion. The completion result is showed as following:After reading Jedi's documents, I find that Jedi has supplied us an API to dynamic get the completion as long as we feed it with locals(). Detail is in jedi.Interpreter class and showed here:https://jedi.readthedocs.io/en/latest/docs/api.html
I want to transfer locals() to Jedi but I failed. When I do the research, I change the code
def _GetResponse( self, handler, request_data = {} ):
toin
~/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/python/jedi_completer.py
Then something interesting(weird) happens, the expected and correct completion appears which is showed in the following figure
So I have two problems:
Do you have any opinions that could make Jedi knows the locals()?
Why does the weird thing happen?
Any suggestions will be appreciated.