gtalarico / ironpython-stubs

Autocomplete stubs for common IronPython/.NET libraries
Other
249 stars 80 forks source link
atom autocomplete clr grasshopper3d ironpython revit-api stubs sublime vscode

IronPython Stubs

Stubs for common IronPython CLR assemblies. These stubs are intended to be used by the autocomplete engine of editors like Atom, Sublime, and Visual Studio Code.

Why IronPython Stubs?

If your are writing python code that targets IronPython, and using modules loaded through the Common Language Runtime (clr), your editor's autocomplete engine (which runs on regular python) will not be able to access those non-native modules. In other words, modules/or packages loaded through clr.AddReference() are not available on your autocomplete engine.

The workaround here is simple: Use IronPython to crawl through these libraries, and create 'stubs' or 'mock objects'. These 'stubs' can then be used by the CPython autocomplete engine. The stubs include doc strings as well as constructor/function/method signatures.

This repository contains the code to create these stubs, and also stores an a version of them that can be used by autocomplete-python.

sublime-large-demo


Documentation

Wiki

The wiki has step-by-step instructions for setting up your stubs for Atom, Sublime, Vim, Visual Studio Code.

For a list of supported Assemblies, see this list

If you haven't yet, read Note on Performance Large Namespaces such as Autodesk.Revit.DB can take a long time to be parsed and cached and might not show up right away.


Contribute - WIP

Generate Stubs - Examples

ipy -m ironstubs make RhinoCommon ipy -m ironstubs make --all ipy -m ironstubs make DSCoreNodes --folder="DSCore" --directory="C:/Program Files/Dynamo/Dynamo Core/1.3"

Process Stubs

WIP

Known Issues

Credits

This project is a fork of the repository started by Gary Edwards on Gitlab. Thank you for your work Gary - and thank you Ehsan for pointing me to it.

It uses PyCharm's Generator3 to create the stubs.