Menu

Code completion for hard coded interfaces

2009-03-19
2013-03-15
  • Ola Hedenstrand

    Ola Hedenstrand - 2009-03-19

    We are using Eclipse with Pydev and Pydev Extension and I have a question regarding code completion and token comments. We does not know how to best receive this functionality in our hard coded python interfaces. We have modules written in non-python languages and provide python interfaces to these modules, not using SWIG wrappers. For functions located in these modules code completion is not available since there is no python code that Pydev could parse, they are just located in binary modules.

    A dirty workaround to this problem could be to generate wrapper files in python, containing stubs with docstrings that can be parsed by Pydev, followed by an import of the real interface module that rebinds all symbols. Today we already produce such stubs, they are used to produce documentation with epydoc.

    For other modules we use doxygen and SWIG and then its quite easy to get code completion and comments to work correctly. Run doxygen and generate xml files, then run doxy2swig.py that converts the xml information into docstrings, and include the generated file in the SWIG configuration.

    Is there any similar process that could be used to solve our problem with the hard coded interfaces. Is there anyway that code completion and token comments, in any format, could be associated with the functions located in the binary modules? Or is there any other way in which this problem could be solved?

    Best regards
    /Ola

     
    • Radim Kubacki

      Radim Kubacki - 2009-03-19

      You can take a look at https://sourceforge.net/tracker/?func=detail&atid=577329&aid=2208316&group_id=85796

      Basically we were solving very similar problem for our project. We register custom IModulesObserver in our special plugin and add tokens that we are able to obtain from this observer (after pydev itself fails). There are some ideas how to do it in a smarter way and you are welcomed to add more.