5
votes

Using PyCharm 3.0.1 Community the code completion works fine, but when I e.g. compelete to a method to one of the parents classes, the inserted method name then gets marked as an unresolved reference. What am I missing?

Details:

I am new to PyCharm, and test it on a (unified installed) Plone 4.3.2. The interpreter from the Installation is selected automatically, and I add the zinstance/bin/zopepy script for buildout.

I then open Products.CMFPlone-4.3.2-py2.7.egg/Products/CMFPlone/SkinsTool.py and then type

x = SkinsTool

at the bottom of the file. The code completion offers me manage_changeProperties (and shows PropertyManager). I select this, so that the line now says

x = SkinsTool.manage_changeProperties

The manage_changeProperties part is marked though. Hovering over the marked 'manage_changeProperties' now shows

Unresolved attribute reference 'manage_changeProperties' for class 'SkinsTool'

Is this a bug or am I doing something wrong (e.g. with importing the project)?

Edit: Following vape's advice I also tried on an instance. Same problem:

Auto-complete works fine:

auto-complete with manage_changeProperties

But then the reference is unresolved:

unresolved message on i

This test was also done with 3.0.1 Professional.

Edit 2: The strucuture is the one of a standard plone installation: structure.txt. I have opened the topmost plone.4.3.2 folder.

Cheers,

Joerg

2
Have you ever solved this? Having the same problem. - theV0ID
There is a bug entry at youtrack.jetbrains.com/issue/PY-11401, which is assigned, but nothing happened yet. - Joerg Baach
Use 3.4, I think it solves the issue. - Games Brainiac
Just tried with 3.4, the issue persists. - Joerg Baach

2 Answers

0
votes

This is likely because there was an error when pycharm generated the skeletons for the plone library. Unless this is a bug, the only way to solve your problem is to delete the .idea folder inside your project. After doing so, reopen the project from the command line using charm <your project dir>. In case you have not made a command line tool for pycharm yet, this is how you do it:

enter image description here

0
votes

Ok, the bug is fixed:

https://youtrack.jetbrains.com/issue/PY-11401

The next release will hopefully contain the fix, until then I compiled my own version.

Two things to note:

  1. Link (or copy) the folder 'help' from the official community release into the intellij-community/python directory.
  2. comile it from that python directory using 'ant -Didea.build.number=140.1332' (I think the actual number doesn't matter)

The result is in intellij-community/out/pycharmCE/artifacts