# ironpython-stubs **Repository Path**: al666ex/ironpython-stubs ## Basic Information - **Project Name**: ironpython-stubs - **Description**: ironpython-stubs跳转程序 - **Primary Language**: Python - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-08-06 - **Last Updated**: 2024-06-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # IronPython Stubs IronPython组件使用的跳转程序。 这些跳转程序的存在是为了方便被代码编辑器(Atom, Sublime, and VSCode)的自动完成引擎调用。 ## 为什么要用 IronPython Stubs? 如果你使用IronPython编写python代码,并且使用通过Common Language Runtime (clr)加载的模块,编辑器的自动完成引擎(普通python运行的那种)没有能力访问那些非原生模块。换句话说,那些通过`clr.AddReference()`加载的模块无法被自动完成引擎所识别。 解决办法很简单:使用IronPython爬取这些库,然后创建‘跳转程序’或者[‘模拟对象’](https://en.wikipedia.org/wiki/Mock_object) 。这些跳转程序能被CPython的自动完成引擎所识别。跳转程序包括文档字符串,以及构造函数/函数/方法签名。 本仓库包含创建这个跳转程序的代码,同时也保存了一个可以被自动完成引擎直接使用的发行版本。 ![sublime-large-demo](https://gitee.com/al666ex/ironpython-stubs/raw/main/docs/sublime/sublime-demo-large.gif) ------------------------------------ # 文档 [Wiki](https://gitee.com/al666ex/ironpython-stubs/wiki) [wiki](https://gitee.com/al666ex/ironpython-stubs/wiki) 里有为Atom, Sublime, Vim, VSCode设置跳转程序的详细步骤。 支持的组件列表,请参阅[此列表](https://gitee.com/al666ex/ironpython-stubs/tree/master/logs) 如果你还没有读到 [性能提示](https://gitee.com/al666ex/ironpython-stubs/wiki/A-Note-on-Performance) ,请注意:像`Autodesk.Revit.DB`这样的大型命名空间需要很长时间去解析与缓存,有可能不会马上生效。 ------------------------------------ # 贡献 - WIP ### 生成跳转程序 - 示例 ``` 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" ``` ### 处理跳转程序 WIP ### 已知问题 * 对于某些大类,性能并没有做到最好。如果你有解决方法请让我知道。 * 某些函数/构建函数的签名丢失或错误。这是Generator3的问题。请发送PR或者如果你有解决方法请让我知道。 * 调用方法会显示错误的参数 ### 致谢 此项目派生于Gary Edwards的仓库 [Gitlab](https://gitlab.com/reje/revit-python-stubs) 。 感谢Gary - 感谢[Ehsan](https://github.com/eirannejad) 让我知道这个项目。 跳转程序生成使用的是PyCharm [Generator3](https://github.com/JetBrains/intellij-community/blob/master/python/helpers/generator3.py) 。