-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support "go to definition" for namespace packages #231
Comments
@swarnendubiswas Please could you provide a code sample of a scenario where 'Go to definition' does not work. |
I understand, but I am referring to a multi-module multi-file project I am working on. I will need to try and create a dummy project to reproduce the problem. Instead for now, I have attached a screenshot. Refer to the static method calls In the screenshot: However, VSC can jump to definition for |
Hmm, thats new information. Assuming you have the following structure in a multiroot scenario:
When using modules from FolderA from code in FolderB, you'd need to modify your PYTHONPATH to help intellisense. One way of doing this is as follows:
|
I have attached a dummy project consisting of a few modules and class definitions. Go to definition does not work for me from the main() function. Please check. |
The problem is all of the packages lack a |
This is quite an annoying aspect of VSCode's python extension and is usually seen as a bug by users who come from other editors. Considering the fact PEP420 has been implemented in Python 3.3 back in 2012, it's not really worth calling this a feature enhancement request. It's simply a total lack of support on a long-incorporated aspect of Python 3; much closer to an actual bug than a lack of some optional feature. |
@scragly we're sorry about the frustration the lack of this feature may have caused you. However, this is something that was not originally on the list of features to be implemented by the extension, hence this is considered an enhancement to the extension. For instance if Python were to introduce a new feature tomorrow, the lack of support in this extension doesn't mean its a bug, its an area of improvement for the extension. I hope this explains why we're leaving this as an enhancement. Please note we will be looking into this however the the number of users demanding this feature will most certainly play an important role in the decision making process. @scragly as a finaly step, please could you 👍 on the top (first) comment so we could keep track of the number of people interested in this issue. |
I already had 👍 the issue when I found it, which is pretty easy to see by hovering over the single 👍that is there. However you've had multiple issues referenced to this one that have been closed and I suspect those are unlikely contributing to the 'number of users demanding this feature' which is unfortunate. And even with those in consideration, it's not reflecting the amount of people who use VSCode who either abandon it because they find the autocomplete and Go To Definition nonfunctional in these cases, or simply don't know it's due to it being a native namespace package and instead assume the IDE's intellisense is simply not reliable. Also python introducing a new feature tomorrow is a bit different from a feature existing since 2012; the expectations from users is simply not comparable between the two situations. |
FYI The Jedi issue for this is davidhalter/jedi#959. (There is also davidhalter/jedi#122 for explicit namespace packages). It would make more sense to patch Jedi than fix it here, probably. |
After a bunch of researching, this might be the most killing-feature missing in VS Code for python. If this also depends on Jedi, the solution might take a while as it comes from 2013 davidhalter/jedi#122 |
A few days ago I think we fixed the remaining issues. If there are still issues, please post a good test case :) |
@davidhalter thanks a lot for resolving this issue. |
Will leave this issue opened, until we've updated VS Code with a version of Jedi that contains the fix. |
Thank you very much @davidhalter, just saw your commits sprint with all the fixes. |
Just for curiosity, I'll be testing setting |
@DonJayamanne Never use master in a release. I do releases for a reason. I'm just saying test it properly without releasing it :) |
@brettcannon This is a quite late follow up to your comment about packages not having a FYI, I can navigate these definitions in Atom. |
I have +1ed the enhancement request. I was developing my code in a way that it is split over multiple packages falling in same namespace. The code for individual packages are in totally separate directories. The intellisense feature is not working in this case as of today. |
This was fixed in LS 0.1.72 |
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
"${workspaceRoot}/src"
].
Expected behavior
What is confusing for me is that "go to definition" works for a few method calls, but not for all.
Steps to reproduce:
Logs
Output from
Python
output panelNo valid output.
Output from
Console window
(Help->Developer Tools menu)No valid output.
The text was updated successfully, but these errors were encountered: