Bug in Hover Name-Resolution?

Pax
2012-01-11
2013-03-15
  • Pax

    Pax - 2012-01-11

    Hello All,

    I am using PyDev 2.3.0 in Eclipse 3.7.1 on Ubuntu 11.10.

    When I import a file system directory into a source folder, the PyDev hover functionality cannot resolve modules etc. in the iported directory if I have chosen  "Create links in workspace" in the import dialog (hover gives error __module_not_in_the_pythonpath__).

    If I however do not choose "Create links in workspace" in the import dialog, hover resolves correctly.

    Is this a bug, or is there a way to fix this so that hover resolves correctly also when code is imported and linked from the worspace?

    Thanks,

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2012-01-11

    It only works if set the same folder you used to create the link as a source folder (otherwise this is expected: PyDev doesn't support links in other places).

    Cheers,

    Fabio

    p.s.: if that doesn't work, please specify more details as paths/source folders so that I can give better advice on it.

     
  • Pax

    Pax - 2012-01-11

    I am not sure I quite follow you there Fabio, but let me explain more exactly the setup:

    I have an Eclipse project at say ~/proj/test_workspace/

    I then have soure code at say /opt/program1/src

    What I would like to do is to create a source folder in the above Eclipse project, import the source code from /opt/program1/src and leave the code at this /opt/… location. That is why I clicked "create links in workspace".

    Are you saying this scheme is not supported by the PyDev Hover resolver?

    Thanks,

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2012-01-11

    You can do that provided you do the following:

    Let's say you have your workspace at:
    ~/proj/test_workspace/

    And create a new project in eclipse at:
    ~/proj/test_workspace/program1

    And want to have the sources for that project at:
    /opt/program1/src

    For that to work you must have

    ~/proj/test_workspace/program1/src mapping to folder link at /opt/program1/src (created through: right click project > new > folder > advanced > link to alternate location).

    And ~/proj/test_workspace/program1/src must be the source folder set in: right click project > properties > pydev - pythonpath.

    This should work properly (note that alternatively you could also just create your project directly at /opt/program1 instead of creating a project inside the eclipse workspace with a link to the sources - just set the proper location on the wizard to create a new pydev project).

    Cheers,

    Fabio

     
  • Pax

    Pax - 2012-01-12

    Hello Fabio,

    and thank you for the reply.

    I tested what you suggested, and it worked fine if you put the exact (leaf) source folder into the python path. The problem is however that under the /opt/program1/src directory there is a big tree of source code subdirectories. It seems the name resolution does not work for the subdirectories under the directory chosen in the project pythonpath source folder list.

    It would be nice to be able to select  /opt/program1/src/* but that is currently not possible to achieve somehow?

    Thanks,

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks