NilsJPWerner / autoDocstring

VSCode extension that generates docstrings for python files
MIT License
676 stars 162 forks source link

Extended summary missing #264

Closed yuvalroo closed 1 year ago

yuvalroo commented 1 year ago

Please excuse me as I am not familiar with .mustache files. It seems that the google.mustache template does not generate an "[extended_summary]" as promised here:

{{name}}                        - name of the function
{{summaryPlaceholder}}          - _summary_ placeholder
{{extendedSummaryPlaceholder}}  - [extended_summary] placeholder

google.mustache:

{{! Google Docstring Template }}
{{summaryPlaceholder}}

{{extendedSummaryPlaceholder}}
{{#parametersExist}}

Args:
{{#args}}
    {{var}} ({{typePlaceholder}}): {{descriptionPlaceholder}}
{{/args}}
{{#kwargs}}
    {{var}} ({{typePlaceholder}}, optional): {{descriptionPlaceholder}}. Defaults to {{&default}}.
{{/kwargs}}
{{/parametersExist}}
{{#exceptionsExist}}

Raises:
{{#exceptions}}
    {{type}}: {{descriptionPlaceholder}}
{{/exceptions}}
{{/exceptionsExist}}
{{#returnsExist}}

Returns:
{{#returns}}
    {{typePlaceholder}}: {{descriptionPlaceholder}}
{{/returns}}
{{/returnsExist}}
{{#yieldsExist}}

Yields:
{{#yields}}
    {{typePlaceholder}}: {{descriptionPlaceholder}}
{{/yields}}
{{/yieldsExist}}

docstring generated using the snippet in VSCode:

from typing import Any

def func(param: Any = None) -> Any:
  """_summary_

  Args:
      param (Any, optional): _description_. Defaults to None.

  Returns:
      Any: _description_
  """
yuvalroo commented 1 year ago

It seems I missed the "Auto Docstring: Include Extended Summary" option in extension's settings.