-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Argument suggestions for some functions in the pytorch module are duplicated when using Jedi #12503
Comments
@CatNofishing, thanks for letting us know about this. What happens when you use the language server? (In your settings.json, set |
@ericsnowcurrently Microsoft language server does not have this problem, but some function parameter suggestions are wrong. For example print(sep=) |
Thanks for checking that. We'd definitely like to resolve any problems you've had with the language server. To that end, I recommend opening a separate issue to address that directly. If you also want to keep using Jedi then we can investigate further. (Otherwise we can close this issue.) I suspect that Jedi is returning multiple results due to some sort of overloading criteria (possibly due to type annotations), though it might also be a bug in Jedi (or the Python extension). Just keep in mind that our ability to address issues in Jedi is limited. Either way, you might also consider contacting the Jedi project directly, to get a faster resolution. I've always found @davidhalter to be responsive, helpful, and committed to the success of his project. |
What version of Jedi are you using currently? It would be interesting to see the results with the latest version. If that happens there as well, it would be clearly a bug. (Happy to fix that ASAP). |
@davidhalter Thank you for your reply, the jedi version I used is 0.15.2. Vscode is also the latest version😁. |
@CatNofishing Can you upgrade to Jedi 0.17.1? It should probably mostly work (and be quite a bit better). If it does not work there I would have to investigate. |
@CatNofishing, the Python extension ships with a vendored copy of Jedi, located in "[])https://code.visualstudio.com/docs/editor/extension-gallery#_where-are-extensions-installed)/pythonFiles/lib/python/" and uses that install explicitly for completions, etc. when configured to use Jedi. So to use a newer version you will need to manually replace the vendored copy with the newer one: #PYEXT_DIR=~/.vscode/extensions/ms-python.python-$(code --list-extensions --show-versions | grep ms-python.python | awk -F'@' '{print $2}')
cd $PYEXT_DIR/pythonFiles/lib
mv jedi jedi.orig
python3 -m pip install --target . jedi Doing that is fine as a one-off to see if the newer Jedi fixes the problem, but the proper solution is for the Python extension to update the vendored copy. So if you feel up to manually installing the newer Jedi version, please give it a try. Otherwise we'll need to investigate further on our end. Either way, please let us know. Thanks! |
@davidhalter @ericsnowcurrently I upgraded jedi to 0.17.1 through the pip command and set the jedi path in vscode, but the parameter suggestion still has duplicate fragments. |
Can you run this?
If you get the same output, then VSCode is might be using Jedi wrong. The mistake might be that they add keyword params as completions, when in fact Jedi does that already by itself (so it results in the repeated entries). |
You have to use |
Can you try again with 0.17.1? Or use the old API |
@davidhalter Thanks your reply!😁 |
@ericsnowcurrently @karthiknadig This problem still exists, do you have any plans to fix this problem, otherwise, I can only use pylance as an alternative. |
same here ... |
@ericsnowcurrently please figure this issue😂,this problem seriously affects the development of jedi. |
Hi @CatNofishing, Is this issue still happening? |
@CatNofishing Try with |
Okay, it works better than jedi , but worse than pylance😥 |
Interested to hear why that is :) Are the completions better? Is it faster? What's the difference? |
😂For pandas and numpy, the speed of pylance intelligent prompt is slightly faster than Jedi when you first import these library. Sometimes Jedi has a delay when you first imports the library,and need to wait for the smart prompt to loading,once the smart prompt is loaded, Jedi will be very fast.And pylance has no problem of duplicate parameters in vscode. But i prefer parameter prompt layout style in Jedi [https://github.com/microsoft/pylance-release/issues/301] |
Oh yes, that's unfortunately a known problem (davidhalter/jedi#1059). Rest assured I'm working on something. It just might take a lot of time, but I'm pretty sure it will be help a lot. |
Closing since it works with JediLSP. |
Reproduce
The text was updated successfully, but these errors were encountered: