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

Update existing docstring

Open pixelneo opened this issue 3 years ago • 2 comments

Why: Now, a new docstring is always created. On a change of some arguments, on function that already has some docstring, that docstring should only be updated – new args added, old ones removed.

pixelneo avatar Jan 19 '23 18:01 pixelneo

methods and functions only (in this issue)

pixelneo avatar Jan 20 '23 17:01 pixelneo

expected behaviour

1. before

def foo(a: str):
    """ Some description
    
    Args: 
        a (str): bar
    
    Returns:
         something
    """
    return 0

2. making changes in function

Changes in function only. Docstring not manually changed.

def foo(a: str, b:int):
    """ Some description
    
    Args: 
        a (str): bar
    
    Returns:
         something
    """
    yield 0

3. regenate docstring

def foo(a: str, b:int):
    """ Some description
    
    Args: 
        a (str): bar
        b (int): 
    
    Yields:

    """
    yield 0

pixelneo avatar Jan 20 '23 17:01 pixelneo