pytorch / pytorch

Tensors and Dynamic neural networks in Python with strong GPU acceleration
https://pytorch.org
Other
83.8k stars 22.59k forks source link

Visual Studio Code not providing autosuggestions for submodules #24353

Open malmaud opened 5 years ago

malmaud commented 5 years ago

Visual Studio Code is not providing autocomplete suggestions for (at least) the nn and optim submodules as of PyTorch 1.2, despite the type stubs for them being valid (as shown by mypy making correct use of them).

This seems to be an upstream bug with Microsoft's Python language server implementation, https://github.com/microsoft/python-language-server/issues/1301.

VitalyFedyunin commented 5 years ago

@malmaud could you please check if it is working with older version of VSC or older versions of pytorch.

malmaud commented 5 years ago

To be honest, I might not have time to do that in the short term (ie next month or two).

I can say that what matters is the version of the Python language server that VSCode is using, not the version of VSCode itself - the VSCode Python extension periodically downloads a new version of the Python language server independently of the VSCode version.

In terms of versions of PyTorch, it's definitely related to the introduction of type stubs, although I'm not exactly sure which stub file is triggering the VSCode bug.

malmaud commented 5 years ago

Also it would be a good idea for people to upvote https://github.com/microsoft/python-language-server/issues/1301 to show the Microsoft team that there is interest in having this resolved upstream.