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

GoTo Definition goes into .pyi files and not the .py ones #529

Closed
ewerybody opened this issue Oct 27, 2020 · 3 comments
Closed

GoTo Definition goes into .pyi files and not the .py ones #529

ewerybody opened this issue Oct 27, 2020 · 3 comments

Comments

@ewerybody
Copy link

Environment data

Version: 1.51.0-insider (user setup)
Commit: e5c0007ce0e9a3816679cba674d03376c03726e3
Date: 2020-10-27T05:37:14.199Z (8 hrs ago)
Electron: 9.3.3
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.19041

Python extension: v2020.9.114305
Pylance: v2020.10.2

Expected behaviour

• I can Ctrl+Click on a function like os.chmod
• I jump to the function definition in the python environment that I'm currently using and can read the according logic.

Actual behaviour

• I end up in C:\Users\eric\.vscode-insiders\extensions\ms-python.vscode-pylance-2020.10.2\dist\typeshed-fallback\stdlib\3\os\__init__.pyi and read a whole lot of mumbo jumbo of what types go in and out withou a single comment or doc string. (I suppose the stubs are generated, right?)

Steps to reproduce:

  1. have code like
import os, stat
os.chmod(path, stat.S_IREAD)
  1. Ctrl+Click on chmod

more

Hello! I see the stubs are awesome and nice. But on a day to day basis, I'd not look into them at all! Am I missing something? I didn't see an issue like that yet and I have the same behavior on a non-Insider VS Code on another machine.
Can I configure this somehow?
Why is this standard?
Is this WIP? Probably huh? Is there more info?
Where?

Cheers! Keep doing great things! <3

@brettcannon brettcannon transferred this issue from microsoft/vscode-python Oct 27, 2020
@jakebailey
Copy link
Member

Duplicate of #65.

Note that we do provide VS Code with both locations if possible (and then it chooses which one to show first).

@ewerybody
Copy link
Author

Well alright. Thanks @jakebailey . But what about WIP? How is this supposed to work in the future? Is there a plan?
For me this is simply broken atm and it was fine in the past.

@jakebailey
Copy link
Member

You can vote on #65 and follow the issue for updates. This is currently the expected behavior as type stubs are a critical part (sometimes the only part) of defining many library's APIs, but if the behavior of jumping to them isn't desired then that could be changed (which is #65).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants