Generating skeletons for PyCharm code completion

Ian McCullough <[email protected]> Wed, 4 Feb 2015 13:44:40 -0500
Newsgroups gmane.comp.python.pyobjc.devel
Message-ID <CADa4atUDtMO6SSTg+yQyg2F+1xxjk9-P3LDkomJPg0DkHjEp=Q@mail.gmail.com>
So I had an idea, and I wanted to see if anyone else had any thoughts on it:

I use PyCharm for all my python development. It has pretty good code
completion for the core python API and has what's called "skeletons" for
other, external modules. These skeletons are discussed in limited detail
here: https://www.jetbrains.com/pycharm/help/using-python-skeletons.html

In short, these skeletons are valid python files with stubs for all the
functions in the module, and ideally, with type annotations for parameters
and return types. This facilitates not only code completion, but allows for
a useful (if not complete) amount of static analysis. Within the libraries
for which skeletons exist, they have proven to be incredible productivity
accelerators.

For me, working with PyObjC has been harder than working with other python
modules because (I assume because of the lazy nature of PyObjC modules)
PyCharm doesn't have, and doesn't seem to generate skeletons for PyObjC
modules. It looks like their generator looks for exported symbols in the
modules, and since it seems that everything for PyObjC is handled
dynamically, the generator doesn't find anything.

That roadblock aside, it seems like with the rich metadata already required
for the bridge, it should be possible to generate skeletons from the PyObjC
modules that would facilitate code-completion and static analysis in IDEs
that support it.

I was planning to hack on this for a little while over my impending
vacation, but I figured I'd put out this message to see if anyone else had
looked into this, or had thoughts on the subject. Sure would be nice to be
able to work with code completion and static analysis for PyObjC modules.

Regards,
Ian

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/

_______________________________________________
Pyobjc-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyobjc-dev