[Pyobjc-dev] Generating skeletons for PyCharm code completion
Brought to you by:
ronaldoussoren
From: Ian M. <ip...@po...> - 2015-02-04 18:45:07
|
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 |