vim-python-docstring icon indicating copy to clipboard operation
vim-python-docstring copied to clipboard

Use of Type Hinting

Open mts299 opened this issue 2 years ago • 3 comments

Add parameter/return types when users include type hint in their code

mts299 avatar Jun 02 '23 16:06 mts299

Hello, thank you for suggestion. The parameter types should already work with the :DocstringTypes command

def foo(A: list[dict[str, str]]) -> int:
    return 1

would get this docstring:

def foo(A: list[dict[str, str]]) -> int:
    """

    Args:
        A (list[dict[str, str]]):

    Returns:
        

    """
    return 1

I plan to include the return type as well.

pixelneo avatar Jun 05 '23 06:06 pixelneo

One other thing, does class documentation not include the methods?

If not I can make another issue if you want :)

I can try to help with coding or testing when I find more time, I really enjoy this plugin <3

mts299 avatar Jun 05 '23 12:06 mts299

Sorry, for the delay...

🤔 you are correct, the class docstring does not contain methods (I use google docstring 99% of the time, which doesn't include it, so I haven't even considered it).

Yes, please create a new issue for this. Definitely, you can try to code the functionality, any MRs are welcome – I can help you with it if you want. (honestly, I don't know when I'll have time to write it myself – it will happen, just can't promise anything.)

Happy to hear, you enjoy the plugin ❤️

pixelneo avatar Jun 08 '23 10:06 pixelneo