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

Intellisense doesnt work for all Pytorch methods #5643

Closed
Coderx7 opened this issue May 16, 2019 · 9 comments
Closed

Intellisense doesnt work for all Pytorch methods #5643

Coderx7 opened this issue May 16, 2019 · 9 comments
Assignees
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug

Comments

@Coderx7
Copy link

Coderx7 commented May 16, 2019

Environment data

  • VS Code version: 1.33.1/1.34.0
  • Extension version (available under the Extensions sidebar): 2019.4.12954
  • OS and version: Windows_NT x64 10.0.17763
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.7 Anaconda3
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Relevant/affected Python packages and their versions: Pytorch 1.0.0 and 1.1.0

Expected behaviour

Intellisense should work on Pytorch methods as well but it does not!

Actual behaviour

It wont work on methods such as mm, matmul, mul, from_numpy, sum, randn, tensor, exp, empty arange, zeros, cat ,etc as described here in details.

Steps to reproduce:

  1. Simply try to use one of the aforementioned torch methods such as sum, empty,randn,tensor,etc

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

Starting Jedi Python language engine.
##########Linting Output - pylint##########
************* Module lesson4_1
9,19,error,no-member:Module 'torch' has no 'exp' member
15,11,error,no-member:Module 'torch' has no 'randn' member
16,10,error,no-member:Module 'torch' has no 'randn_like' member
17,7,error,no-member:Module 'torch' has no 'randn' member
20,4,error,no-member:Module 'torch' has no 'sum' member
23,0,error,no-member:Module 'torch' has no 'empty' member

----------------------------------------------------------------------

Your code has been rated at -11.43/10 (previous run: -11.43/10, +0.00)
@ghost ghost added the triage-needed Needs assignment to the proper sub-team label May 16, 2019
@DonJayamanne
Copy link

Please could you try switching to the Language Server.
Please check here for instructions #3977

Let me know whether this resolves the problem for you.

@DonJayamanne DonJayamanne added the info-needed Issue requires more information from poster label May 16, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label May 16, 2019
@DonJayamanne DonJayamanne added triage-needed Needs assignment to the proper sub-team area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug labels May 16, 2019
@ghost ghost removed triage-needed Needs assignment to the proper sub-team labels May 16, 2019
@DonJayamanne DonJayamanne added triage-needed Needs assignment to the proper sub-team triage labels May 16, 2019
@DonJayamanne DonJayamanne self-assigned this May 16, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label May 16, 2019
@Coderx7
Copy link
Author

Coderx7 commented May 17, 2019

@DonJayamanne : I had a look at the link you provided. the problem is I cant find a way to install Language Server, as the instructions given there doesn't work for me.
I dont have a Language Server folder, to remove in first place!
This is how my extension directory looks like :
image
and this is the contents of ms-python.python folder :
image

I just updated the VSCode to the latest version couple of hours ago and this has not changed (i.e. no language server is installed)
I'd appreciate any feedback on how to get that installed so I can give you the result you need.

@DonJayamanne
Copy link

All you need to do is:

Go into your settings.json, set "python.jediEnabled": false.

@Coderx7
Copy link
Author

Coderx7 commented May 17, 2019

Thanks, I did so and language server seem to have its own share of issues, while the mentioned methods now show up in intellisense, the presentation is different and more importantly, intellisense doesnt work flawlessly here either, here is a demonstration show casing the issues:
vscode_pytorchintellisense2

(side note: jediEnabled presentation/look is much more desirable than what is being provided by language server! apart from its bugs! I myself prefer jediEnabled over language sever)

@DonJayamanne
Copy link

here is a demonstration show casing the issues:

Please note, you have jedi enabled. Please change the value to false.
Once done, please provide an animated gif as done previously. Thanks a lot.

@Coderx7
Copy link
Author

Coderx7 commented May 17, 2019

@DonJayamanne In the gif I posted above, I tested both scenarios, both with jediEnabled set to true and false!
Just watch the whole gif to the end and you'll see the difference between the two.
I start with JediEnabled and show how it works, and then disable it and show how language server works

@DonJayamanne
Copy link

When using Jedi, the auto completion list is provided by an external package and we do not have much control over that. Please feel free to report an issue on their repo https://github.com/davidhalter/jedi.

On the other hand the language server is something that's built by us.
Hence I'll be moving this issue to the language server repo so they can address the issues/concerns you have.

@DonJayamanne
Copy link

Issue moved to microsoft/python-language-server #1098 via ZenHub

@ghost ghost removed info-needed Issue requires more information from poster triage labels May 17, 2019
@Coderx7
Copy link
Author

Coderx7 commented May 30, 2019

@DonJayamanne :
Hi , Concerning the Jedi, I have reported this to the jedi author and he is willing to rectify the issues but in order to fix the issues with vscode, there are couple of questions:

  1. Can we manually update Jedi in vscode? (by replacing the files in the extension directory(.vscode\extensions\ms-python.python-2019.4.12954\pythonFiles\lib\python\)?) will this simply work or is there something else that I should be aware of?

  2. Is there any kind of logging mechanism in vscode, which we can use to see what went wrong? (in our case, simply doing the manual update, breaks the intellisense, we want to know what has caused this to fail, any kind of debugging log is appreciated.)

@lock lock bot locked as resolved and limited conversation to collaborators Jun 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

2 participants