sublime_docblockr_python icon indicating copy to clipboard operation
sublime_docblockr_python copied to clipboard

Update docstring

Open asetGem opened this issue 6 years ago • 0 comments

When the first version of a function takes some parameters, it generates the right docstring, that we just have to complete. However, if we change the function by adding/removing parameter(s), and adding/removing a return, the docstring is not automatically updated. The only solutions I found are:

  • either complete by myself, following the format generated Problem: must know the format rules (which is supposed to be simplified by using docblockr_python). For example, if there was no return in the function when we first generated the docstring, and now there is one, we have to check the format to know how to add our return value with its type and description.
  • or re-generate docstring, and then copy all descriptions/types of all parameters I already filled before Problem: time consuming... We are kind of writing the docstring twice...

It would be great if we could update the current docstring.

For now, hitting 'tab' after the starting """ generates a docstring.

What would be great:

  • When hitting 'tab', when there is already a docstring, generate an updated version of it (or do not change if nothing changed in function parameters/return of course...)
  • If a parameter is already in the docstring, then do nothing.
  • Otherwise, add it with default "description"/"type".

Do you think this could be possible?

Thanks

asetGem avatar May 20 '19 20:05 asetGem