visual-studio-codedocstringpylance

Docstring formatting not working in VSCode


Minor issue. Some days ago, docstrings would be formatted so that when I hover over them, "Args" (Google-style) and "Returns" would be in bold, as well as the names of the arguments. This made it more readable.

def add(a: int, b: int) -> int:
    '''Add two numbers

    Args:
        a: first number
        b: second number

    Returns:
        c: third number
    '''

    c = a + b
    return c

add(3, 4)

Now when I hover over "add" I get:

Docstring rendering

Is this because of some Pylance update?


Solution

  • I fixed the issue by setting this option to true: "python.analysis.supportRestructuredText": true