autoDocstring icon indicating copy to clipboard operation
autoDocstring copied to clipboard

Epytext format doctoring

Open meimchu opened this issue 6 years ago • 7 comments

Hi there, I am coming from a PyCharm background and have recently made a move to VS Code. One of the extensions I downloaded was this wonderful autoDocstring but I noticed it is missing the python Epytext docstring style that I have been using in PyCharm. I would like to make a request to have this be one of the available drop down style! Thank you and great extension.

Here is the website for their docstring style: http://epydoc.sourceforge.net/

meimchu avatar Dec 08 '19 00:12 meimchu

same request. please. Thanks

wingmor99 avatar Dec 09 '19 20:12 wingmor99

Hi @meimchu & @wingmor99 I have created an epytext template in this pr: https://github.com/NilsJPWerner/autoDocstring/pull/95 The documentation for epytext is a little sparse around kwargs and doesn't mention yield so I took some liberties in creating it. If this looks good to you I will merge it in.

NilsJPWerner avatar Dec 13 '19 04:12 NilsJPWerner

Thank you for your timely response. I shall take a look and in the meantime, I did a test in PyCharm passing *args and **kwargs and its Epytext docstring returned as such:

class MyTest():
    def __init__(self, *args, **kwargs):
        """
        
        @param args: 
        @param kwargs: 
        """
    
        
myTest = MyTest(1, hello="hello", world="world")

According to http://epydoc.sourceforge.net/fields.html though, it seems to suggests @kwarg p:, @kwparam or @keyword p:... so I guess PyCharm is not getting that entirely right either :(

meimchu avatar Dec 13 '19 07:12 meimchu

I did a test with args and kwargs. I called on the autoDocstring after creating the function, of course. Evidently something about the args and kwargs is not auto-completing.

def test_func(*args, **kwargs):
    """[summary]

    @return: [description]
    @rtype: [type]
    """
    return args, kwargs
print test_func('1', '2', hello='World')

def test_func(arg_one, arg_two):
    """[summary]
    
    @param arg_one: [description]
    @type  arg_one: [type]
    @param arg_two: [description]
    @type  arg_two: [type]
    @return: [description]
    @rtype: [type]
    """
    return arg_one, arg_two
print test_func('1', '2')

meimchu avatar Dec 18 '19 07:12 meimchu

Hi @meimchu, the extension doesn't really deal with **kwarg. Could you try with a regular kwarg like arg2="abc"?

NilsJPWerner avatar Dec 18 '19 13:12 NilsJPWerner

Could you elaborate what you mean by "regular kwarg"? For example, def test_func(arg1="abc", arg2="xyz"):, similar to my second example posted above, would just mean they're basic parameters, right? The * and ** in front of the parameter, the unpacking operator is what's important. I tried modifying the mustache file to include * and ** to no avail, unfortunately. What is the main difficulty in incorporating those unpacking operators, I'm curious? Really appreciate all your effort so far!

meimchu avatar Dec 19 '19 07:12 meimchu

thanks !

wingmor99 avatar Aug 14 '21 08:08 wingmor99