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() does not always return a definition for the target node #1507
Comments
What's your use case? I don't understand why you wouldn't want this. |
I'm one of the maintainers of Sourcetrail where we use Jedi for our Python indexer. What happens behind the scenes:
So for this, no matter what the context of a name's usage is (e.g. in a class definition or in a class instantiation), we were expecting Jedi to always return the node's definition. |
The question is probably why you're using parso. It's possible to do this with Jedi: At that point you can use each If you really need parso (for whatever reason, but you probably don't), I suggest you use |
Thanks for your quick replies and for your clear statements. I will check your suggestions to get around this. |
I see that for implementing issue #1175 the behavior of the
goto
function has been changed slightly to return the definition of the overridden method if the node at the target location is already a definition.This may be handy for some usecases, but others (like me) may rely on the old behavior. As an example: I am using the
goto()
function to get a "canonical" version of a node.Would it be possible to add an optional parameter to the
goto()
function that prevents this new behavior?The text was updated successfully, but these errors were encountered: