Go To --> Implementation Problem

Hello,

I'm a professional python developer, and I've been eagerly wanting to get into using PyCharm over Eclipse for various environmental/productivity reasons. During my trial, I've been having some issues with following imports to their implementation.

A quick look at a piece of my project workspace:
trunk/
  |
  | — django/
  | — mycode/

An example (from within mycode/):

from django.http import HttpResponse

When right clicking on HttpResponse, selecting Go To –> Implementation(s), nothing happens. However, if I follow the same steps on http in "from django.http", the file is properly opened. It seems odd to me that the file is known, yet I'm unable to jump to the function declaration. Every import I try has the same problem. Am I configuring something incorrectly?

Any help would be much appreciated.

Thanks!
8 comments
Comment actions Permalink
The shortcut you need is "Goto Declaration", not "Goto Implementation".
0
Comment actions Permalink
None of the "Go To"s actually do anything when trying to follow a "from" import.
0
Comment actions Permalink
Update: PyCharm 2.7 allows me to follow declarations, with one exception:
from xxxx import yyyy as zzzz

I can follow xxxx and yyyy, but not zzzz.
0
Comment actions Permalink
That's normal behavior. zzzz is not a reference to anything, it's a local declaration of the name.
0
Comment actions Permalink
Really? Hm. Definitely seems strange to me, because following a usage of zzzz() will jump to the declaration of yyyy.
0
Comment actions Permalink
Why is it strange? This import statement defines a local name "zzzz" which is an alias for the imported name "yyyy". A usage of "zzzz" navigates to the imported element, which is "yyyy". Goto Declaration on "zzzz" doesn't do anything, just as Goto Declaration on a "def foo()" doesn't do anything: you're already on a declaration.
0
Comment actions Permalink
Makes sense. With that logic, why then doesn't the "go-to declaration" jump to the "as zzzz" import declaration?
0
Comment actions Permalink
Because we consider it to be less useful than jumping to the original definition.
0

Please sign in to leave a comment.