question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support "go to definition" for namespace packages

See original GitHub issue

Environment 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

  1. I have run exuberant ctags and have generated tags file in ${workspaceRoot}/.vscode/tags. I have also set “python.autoComplete.extraPaths”: [ “${workspaceRoot}/src” ].
  2. Select a function call and press F12, “Go to definition”. Visual Studio Code says “No definition found”.

Expected behavior

  1. 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:

    1. 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:closed
  • Created 6 years ago
  • Reactions:30
  • Comments:19 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
swarnendubiswascommented, Jun 27, 2018

@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.

1reaction
elliott-beachcommented, Feb 6, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found