Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse "go to definition" problem

I'm using PyDev for eclipse and am experiencing some issues with "go to definition". It works for most modules, but for some site packages it does not. It does the "bump" sound and then nothing happens. One of the packages that doesn't work is Twisted, which is weird since the source is included and right there. Any idea how to fix this?

like image 247
quano Avatar asked Aug 01 '09 07:08

quano


2 Answers

The go to definition works just fine. The problem was that eclipse didn't know where to find the source. You can go to window > preferences > pydev > interpreter > New folder, and add the folders missing. Even though you've added site-packages to the configuration, you still have to add subfolders separately to get code assist and to be able to go to the definition.

alt text

like image 170
quano Avatar answered Sep 28 '22 07:09

quano


Pydev (also bundle with the Aptana distro) does not seem to have any bug exactly similar to the one you are describing.

Here is the list of bugs including the word "definition" for PyDev: bugs
You could open a bug report there with the exact version of eclipse, pydev, java used

But first:
What version of Pydev are you using? The open-source one or the commercial one (i.e. open-source + Pydev extensions)?
Because the matrix feature is quite clear:

Feature List        Pydev "Open Source"     Pydev Extensions
---------------------------------------------------------------
Go to definition    BRM*                    Pydev Extensions(2)

BRM*: Bicycle Repair Man is an open-source program that provides 'go-to-definition' and refactoring. Its 'go-to-definition' only works for Python, and only works 'well' for global or local tokens (does not work very well on methods from parameters or on 'self'). It is currently 'unsupported'.

Pydev Extensions (2): Pydev extensions provides a 'go-to-definition' that works for python and jython, and should work even on methods from parameters and 'self'.

like image 26
VonC Avatar answered Sep 28 '22 07:09

VonC