Type hints not resolving

I have a somewhat complex project with multiple directories marked as "source folders" inside of each are collections of Python modules.

The problem I'm having is that PyCharm 3 and IDEA 13 + Python Plugin are not resolving all of the modules in these directories when they are referenced in :type: lines in docblocks.

The classes are resolved fine in the code itself and I can click-navigate – but they do not resolve in the docblocks. Simple types resolve, and classes within the same file resolve, but things like mod.submod.Class do not link to the declaration.

This problem disables code completion and other nice features, too.

The same exact project works perfectly in IDEA 12 + Python plugin.

Does anyone have any ideas what I'm doing wrong? Or where I can start looking to try to figure this out? It's really putting a damper on using the newer versions.
6 comments
Comment actions Permalink
No, no idea what's going on but I'm having the same problem!

There are some type hints that just are not evaluated properly and I haven't found out what is special about them or what I am doing wrong. In my case navigation through quick documentation on symbols works (i.e. clicking on class names of the signature in quick documentation popup) but code completion does not.

One thing I have done as workaround at places:
result = someobj.call_that_return_complex_object()
""" :type: SomeComplexObject """
result.some_method()
prettyPrint();
Not pretty (actually, it's pretty ugly), but brings back code completion.

One thing I have found out so far: rtype seems to be picky about spaces. :rtype: SomeClass|SomeOtherClass does lead to code completion, but not :rtype: SomeClass | SomeOtherClass (note the additional spaces around |. Also, empty lines between the annotations probably need to be right. I'm always checking the quick documentation popup to make sure that types show up properly there.

Would you mind filing an issue in YouTrack and post a link here? I'll add my own findings to that issue then.

I'm using IDEA 13/Python plugin with Python 2.7 and type annotations in strings.
0
Comment actions Permalink
I can't figure out how to reliably reproduce the issue. If I create a new project with a simple structure, the resolution of types in docblock seems to work.

If I could get JetBrains' attention on this, I'd be happy to share my project in its entirety.
0
Comment actions Permalink
I suppose creating an issue in YouTrack would help. They don't seem to be monitoring this forum closely.
0
Comment actions Permalink
Hi Joshua,

please create an issue in our tracker. You can change visibility level there to pycharm-developers to share your project.
0
Comment actions Permalink

Was a tracker ever submitted for this, as this problem still seems to exist in PyCharm 5.0.4 and its a real pain.

0

Please sign in to leave a comment.