在 Eclipse 中自动生成 Python 源代码中的虚拟文档
当时我正在记录我的很多代码(Python),我想知道 Eclipse 是否有一个插件可以自动为我的函数生成文档字符串,就像 Visual Studio 在编写 // 时为 C# 所做的那样/
方法。
我一直在寻找解决方案,但我没有运气 - 你们有人知道解决方案吗?
示例:
从方法的参数列表中,将在我的方法定义下创建“虚拟”文档,如下所示:
def myFunction(self, a, b):
"""
:param a:
:type a:
:param b:
:type b:
:return:
:rtype:
"""
return 'Hello, world'
At the time I am documenting a lot of my code (Python) and I was wondering if there is a plugin to Eclipse that can automatically generate a doc string for my functions, like visual studio does it for C# when writing ///
over a method.
I have been searching around for a solution, but I had no luck - do any of you know a solution?
Example:
From my parameter list on a method the "dummy" documentation will be created under my method definition as shown below:
def myFunction(self, a, b):
"""
:param a:
:type a:
:param b:
:type b:
:return:
:rtype:
"""
return 'Hello, world'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,根据 此文档,如果您按 Ctrl + 1 在方法名称上,您将得到您需要的内容。
对于您的示例(编辑:如果您将选项 PyDev>Editor>Code Style>Docstrings>Doctag Generation 设置为始终获取参数的类型),您将得到:
Well, according to this doc, if you press Ctrl + 1 on a method name, you will get what you need.
For your example (EDIT : if you set the option PyDev>Editor>Code Style>Docstrings>Doctag generation to always to get the type of the param), you will get :