开发者

How do I get Pydev to recalculate imports (remove red x's)?

I often create a Pydev (say, Google App Engine) Eclipse project with the wrong PYTHONPATH. It's missing "lib", say. The pro开发者_如何学Goject is filled with red x's meaning errors. Fine. I update the project PYTHONPATH to what I know will fix the problem, and the problem remains.

Now, if I visit (i.e. double-click into the editor) any individual file, Pydev excitedly reparses, and the red x's disappear. So I could get rid of them all by visiting each file! That is terrible. Refreshing or opening and closing the project, even closing and reopening Eclipse do not seem to work. Ideas?

I'm using Galileo (build 20100218-1602 of Eclipse) and 1.5.5.2010030420 of Pydev.


One way is to go into your PYTHON Path within your project settings and hit apply, this forces a refresh.


Try selecting the Project → Clean from Eclipse's menu, then either selecting the project in question or "clean all projects". That should force Eclipse to regenerate all the error markers over the entire project.

Trying that in conjunction with forcing a refresh of the PYTHONPATH (as described by tlow) might be the best bet.


In the latest PyDev, you can right click a folder in the PyDev package explorer and then choose either:

  1. PyDev > remove error markers (just to remove the error markers without making a new analysis).

  2. PyDev > code analysis, to make a code-analysis of the modules below that folder.

Note that from PyDev version 2.1 onwards, PyDev will by default only analyze files that are opened in an editor, so, option 2 would be the proper way of doing a code-analysis for many files at once without having to open it in an editor.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜