autoDocstring
autoDocstring copied to clipboard
Does not generate docstring with @dataclass decorator
Describe the bug It does not generate correct docstring when defining a class using @dataclass decorator method. It works fine with traditional class initialization. I have even tried with all available formats and nothing works.
Versions (please complete the following information):
- autoDocstring Version: 0.5.4
- Operating System: Windows 10 (WSL)
- Vscode Version: 1.51.1
Original Code (with line to generate on):
@dataclass
class MyClass:
# generate on this line
para_a: int=1
para_b: str=None
para_c: Tuple[int, str]=(1,'a')
Expected Result:
@dataclass
class MyClass:
"""[summary]
Parameters
----------
para_a : int, optional
[description], by default 1
para_b : str, optional
[description], by default 'abc'
para_c : Tuple[int, str], optional
[description], by default (1,'a')
""
para_a: int=1
para_b: str=None
para_c: Tuple[int, str]=(1,'a')
Actual Result:
@dataclass
class MyClass:
"""[summary]
"""
para_a: int=1
para_b: str=None
para_c: Tuple[int, str]=(1,'a')
This plugin is only writing docstrings for python functions, not classes.
This plugin is only writing docstrings for python
functions, notclasses.
But it does work with traditional class initialization using def __init__(). I use it all the time.
I would love to have this feature as well!
+1 I would love to have this feature as well!
Came here hoping for an answer, but I'd love to see this feature added!
Yup, this feature would be great
+1