在 PyDev Eclipse/Aptana 中仅显示 python 函数 def
有没有办法在一个巨大的Python文件中,你只看到你感兴趣的函数def?我记得 Eclipse 有一个选项可以在 Java 中执行此操作,并且非常有帮助。PyDev/Aptana Studio 3 中的 Python 怎么样?
Is there a way in a huge python file , you just see the function def you are interested in ? I remember Eclipse has an option to do this in Java and it was pretty helpful.How about for Python in PyDev/Aptana Studio 3?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在窗口中查看>首选项> PyDev >编辑>代码折叠。启用函数定义的折叠。然后按
Ctrl-9
和Ctrl-0
折叠和展开代码。编辑:您还可以使用
Ctrl--
(减号)和Ctrl-=
折叠和展开单个级别。Look in Window > Preferences > PyDev > Editor > Code Folding. Enable Folding for Function Definitions. Then hit
Ctrl-9
andCtrl-0
to fold and unfold your code.Edit: You can also use
Ctrl--
(minus) andCtrl-=
to fold and unfold single levels.您可以做的是使用带有过滤器的常规轮廓(Alt+Shift+QO)。
如果您确实无法仅使用所需的功能来创建过滤器,则可以以以下格式向代码添加注释:“#--- comment”,然后这些注释应出现在大纲中,然后执行过滤器只留下那些可用的评论。
请注意,有时快速大纲已经足够好了(Ctrl+O),但目前还不行将这些评论显示为常规大纲。
另一个解决方案可能是使用书签 - ctrl+F10,添加书签 - 有关正确使用书签的提示,请访问:如何在 eclipse 3.4.1 中导航到书签?
What you can do is use the regular outline (Alt+Shift+Q O) with a filter.
In case you can't really make a filter with just the functions you want, you can add comments to your code in the format: "#--- comment" and those comments should then appear in the outline and then do a filter that leaves only those comments available.
Note that sometimes the quick outline is already good enough (Ctrl+O), but it currently doesn't show those comments as the regular outline.
Another solution could be using bookmarks -- ctrl+F10, add bookmark -- there are tips for using the bookmarks properly at: How to navigate to a bookmark in eclipse 3.4.1?