Skip to content

Doesnt get the arg if contains an accent mark #308

@DavidPPMerino

Description

@DavidPPMerino

Describe the bug
When generating the docstrings if one of the args have an accent mark like "preço" or "você" doesnt generate the line or generate half of the arg only until the accent mark.

Versions (please complete the following information):

  • autoDocstring Version: 0.6.1
  • Operating System: Windows 10
  • Vscode Version: 1.103.2

Original Code (with line to generate on):

def diminuir(preço = 0, taxa = 0, formato = False):
    # generate on this line
    res = preço - (preço * taxa / 100)
    return res if format is False else moeda(res)

Expected Result:

def diminuir(preço = 0, taxa = 0, formato = False):
    """
    _summary_

    Args:
        preço (int, optional): _description_. Defaults to 0.
        taxa (int, optional): _description_. Defaults to 0.
        formato (bool, optional): _description_. Defaults to False.

    Returns:
        _type_: _description_
    """    
    res = preço - (preço * taxa / 100)
    return res if formato is False else moeda(res)

Actual Result:

def diminuir(preço = 0, taxa = 0, formato = False):
    """
    _summary_

    Args:
        taxa (int, optional): _description_. Defaults to 0.
        formato (bool, optional): _description_. Defaults to False.

    Returns:
        _type_: _description_
    """    
    res = preço - (preço * taxa / 100)
    return res if formato is False else moeda(res)

Debug log:
Set autoDocstring.logLevel to "Debug", recreate the bug, and then copy the debug logs from the autoDocstring output channel.

[DEBUG 18:17:00.202] DocstringFactory Configuration
quoteStyle:
    """
startOnNewLine:
    true
guessTypes:
    true
includeName:
    false
includeDescription:
    false
template:
{{! 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}}

[DEBUG 18:17:00.204] Docstring parts:
    Name:
        aumentar
    Decorators:
        N/A
    Args:
        N/A
    Kwargs:
        taxa int 0
        formato bool False
    Exceptions:
        N/A
    Returns:
        N/A
    Yields:
        N/A
[DEBUG 18:17:00.204] Default indentation: "    "
[DEBUG 18:17:00.204] Indentation: "    "
[INFO 18:17:00.206] Docstring generated:
    """
    ${1:_summary_}

    Args:
        taxa (${2:int}, optional): ${3:_description_}. Defaults to 0.
        formato (${4:bool}, optional): ${5:_description_}. Defaults to False.

    Returns:
        ${6:_type_}: ${7:_description_}
    """
[INFO 18:17:00.206] Inserting at position: 47 0
[INFO 18:17:00.225] Successfully inserted docstring

Stack trace:
If an error was reported by autoDocstring please copy the stack trace from the autoDocstring output channel.


Additional context
Seems that in some just simply dont create the line but on another just create until the accent marked letter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions