"Go To Declaration" goes to definition/implementation instead

"Go To Declaration" goes to definition/implementation of a given method instead. It should go to where the method is declared i.e. to the place where it's being imported which makes it visible and accessible in a given scope.
Comment actions Permalink
I think the current behaviour is correct.
The import is not the method declaration after all (and you could use the method without importing it, like module.method()).

However, yes, a way to navigate to the import would be welcome.
Comment actions Permalink
The import in Python is the function/class declaration – there's no other way to make function/class available in given module (short of implementing it in this very same module). Using module.method() doesn't change this – you can think of this as implicit method declaration.

Generally terminology used in "Navigate" menu is misleading. "Implementation(s)" is concerned with implementation(s) of subclasses whereas I bet most people think of it as "implementation of the thing I'm currently looking at" when they see it.

I suggest that:
"Declaration" goes to import (one can argue it should also be renamed to "Import" then).
"Implementation" goes to implementation of given function/class.
"Subclass(es)" goes to implementation of subclass thus it's the same as current "Implementation(s)".

I have a feeling that entries in "Navigate" menu come from IDEA's support for Java and there was not too much thought in how they should look like in Python.

Please sign in to leave a comment.