"Go to definition" on module takes you to __init__.py instead of actual module
See original GitHub issueEnvironment data
- VS Code version: 1.29.1
- Extension version (available under the Extensions sidebar): 2018.11.0
- OS and version: Windows 10 64-bit
- Python version (& distribution if applicable, e.g. Anaconda): Conda 3.7.1
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): venv
- Relevant/affected Python packages and their versions: None
Actual behavior
“Go to definition” on module takes me to __init__.py
rather than the module I actually selected.
Expected behavior
“Go to definition” on module takes me to the module I selected.
Steps to reproduce:
Using the jedi language engine:
Logs
Output for Python
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python
)
# there is no output, as seen in the screencap above
Output from Console
under the Developer Tools
panel (toggle Developer Tools on under Help
)
# there is no output, as seen in the screencap above
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:14 (1 by maintainers)
Top Results From Across the Web
python - What is __init__.py for? - Stack Overflow
When a regular package is imported, this __init__.py file is implicitly executed, and the objects it defines are bound to names in the...
Read more >Understanding Python imports, __init__.py and pythonpath
The python interpreter tries to look for the directory containing the module we are trying to import in sys.path . It is a...
Read more >6. Modules — Python 3.11.1 documentation
A module is a file containing Python definitions and statements. ... use your favorite text editor to create a file called fibo.py in...
Read more >How to create a Python Package with __init__.py
Use the interactive interpreter (The REPL) to import the modules and see if you are getting what you expect. · Start your script...
Read more >Package Initialization - Real Python
If a file named __init__.py is present in a package directory, it's going to be ... Python Modules and Packages: An Introduction ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Unable to replicate in the latest version of Jedi and parso, hence we should upgrade.
@brettcannon I cannot reproduce this anymore in vscode 1.41.1. To me, this issue seems completely fixed. I’ve tested the same case as above with both jedi and the python language server! 👍 🎉