Support "go to definition" for namespace packages
See original GitHub issueEnvironment data
VS Code version: 1.18.0 Python Extension version: 0.8.0 Python Version: 3.5.4 OS and version: CentOS 7.4
Actual behavior
- I have run exuberant ctags and have generated tags file in ${workspaceRoot}/.vscode/tags. I have also set “python.autoComplete.extraPaths”: [ “${workspaceRoot}/src” ].
- Select a function call and press F12, “Go to definition”. Visual Studio Code says “No definition found”.
Expected behavior
- I expect Visual Studio Code to jump to the right tag. “Go to symbol in workspace” is able to find the matching tag.
What is confusing for me is that “go to definition” works for a few method calls, but not for all.
Steps to reproduce:
-
- Select a function call and press F12, “Go to definition”. Visual Studio Code says “No definition found”.
Logs
Output from Python
output panel
No valid output.
Output from Console window
(Help->Developer Tools menu)
No valid output.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:30
- Comments:19 (1 by maintainers)
Top Results From Across the Web
Packaging namespace packages
Namespace packages allow you to split the sub-packages and modules within a single package across multiple, separate distribution packages (referred to as ...
Read more >Python Namespace Packages in Python3 - Stack Overflow
Use native namespace packages. This type of namespace package is defined in PEP 420 and is available in Python 3.3 and later. This...
Read more >Namespaces - cppreference.com
Namespaces provide a method for preventing name conflicts in large projects. Symbols declared inside a namespace block are placed in a named ...
Read more >Packages Create Namespaces - MATLAB & Simulink
Packages are special folders that can contain class folders, function, and class definition files, and other packages. The names of classes and functions...
Read more >namespace keyword - C# Reference - Microsoft Learn
The compiler adds a default namespace. This unnamed namespace, sometimes referred to as the global namespace, is present in every file. It ...
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
@brettcannon This is a quite late follow up to your comment about packages not having a
__init__.py
. However,Go to definition
does not work even if I add a__init__.py
.FYI, I can navigate these definitions in Atom.
FYI The Jedi issue for this is https://github.com/davidhalter/jedi/issues/959. (There is also https://github.com/davidhalter/jedi/issues/122 for explicit namespace packages). It would make more sense to patch Jedi than fix it here, probably.