Repository navigation
PythonVScode extension doesn`t seem to implement jedi properly - the extension cannot locate the correct symbol definition #171
Description
Activity
- addedarea-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug
on Nov 14, 2017 All we've done is triaged the issue. No specific plans on addressing this issue have been made yet.
Don Jayamanne (@DonJayamanne) do you happen to know how we may not be hooking into Jedi fully as suggested by circlecrystal? I've verified that at least with:
import csv import io buf = io.BytesIO() writer = csv.writer(buf)
doesn't lead to intellisense for
writer.Are you sure this is really an issue with Jedi? Try this:
import jedi script = jedi.Script(source="""\ import io import csv buf = io.BytesIO() writer = csv.writer(buf) writer. """, line=6, column=7) print(script.completions())
It returns no completions for me. I think Jedi is having trouble since
_csv.writeris a builtin function. At least that's for the first mentioned issue, not sure about the rest...- Could you post a snippet of code for which completions work for you in some other editor and doesn't in VS Code? With the editor, plugin, Jedi and Python version used so it can be reproduced. Note that I only tried the first issue mentioned here. BTW did you try the snippet? בתאריך 2 בפבר' 2018 21:13, "Scott" <[email protected]> כתב:…@segevfiner <https://github.com/segevfiner> It doesn't appear any other editor I have tested with Jedi is having this issue. I've used it with Vim & Atom. I have also used the alternative language server <https://github.com/palantir/python-language-server> which relies on Jedi, with no issues. Its seems that a few updates ago coding in Python completely broke in vscode. I haven't been able to use it since. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#171 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AXlg_5ujKfE1tVQVzneIC-MfVVEnVpQCks5tQ15EgaJpZM4Qdo2P> .
For the third issue. Showing the values of stuff is done, in Atom at least, by this bit of code:
https://github.com/Microsoft/vscode-python/blob/fafd0f8888b8d6a9a995b8da4495c8a83d3f9a9e/pythonFiles/completion.py#L60-L70
Called from here:
https://github.com/Microsoft/vscode-python/blob/fafd0f8888b8d6a9a995b8da4495c8a83d3f9a9e/pythonFiles/completion.py#L220It shows it on the right hand side of a completion suggestion. VS Code is probably not using this property. Only showing the doc string for the type of the completion which is what we are seeing (I think it might even be getting the doc string by itself rather than relying on Jedi).
P.S. The code throws a bunch of lint warnings from a linter like flake8, and in particular
ARGUMENT_REis not defined for this bit of code:
https://github.com/Microsoft/vscode-python/blob/fafd0f8888b8d6a9a995b8da4495c8a83d3f9a9e/pythonFiles/completion.py#L254-L255
Though it's probably currently unused by this extension.Here is the behavior in Atom, by the way (I couldn't figure out issue no. 2):
For
csv.writer:For constants:
This is using python2, atom 1.23.3, and autocomplete python 1.10.5. As to what version of Jedi they use, it's custom-patched, but available at https://github.com/autocomplete-python/autocomplete-python/tree/223e0c7ae2a97008c80709bac3d5d2c12807437a/lib/jedi.
MikhailArkhipov commented
on Feb 17, 2018 More actions- locked as resolved and limited conversation to collaborators
on Jul 11, 2018




From circlecrystal on August 28, 2017 4:47
(* The imported class in the above and below showcase is with the Python standard library.)
As I also investigated this issue a lot, I found it is not the problem of jedi itself. It is vscode python extension does not use the jedi as correctly as it should.
That`s why we have this problem haunting many of us python programmers who are using this extension right now.
Copied from original issue: DonJayamanne/pythonVSCode#1182