pylance-release icon indicating copy to clipboard operation
pylance-release copied to clipboard

One dot is missing for leading ellipsis in doc markdown

Open Azureblade3808 opened this issue 2 years ago • 0 comments

Environment data

  • Language Server version: v2022.6.20
  • OS and version: Windows 7
  • Python version (& distribution if applicable, e.g. Anaconda): 3.8.12 Anaconda

Code Snippet

def annotation(x):
    """
    Example
    -------
    >>> class C:
    ...     @annotation
    ...     def f():
    ...         ...
    """
    return x

Repro Steps

  1. Copy and paste the code snippet into a python file.
  2. Hover annotation and see its doc.

Expected behavior

The doc markdown is rendered correctly.

Actual behavior

Every leading ellipsis is short of one dot. image

Additional Info

  1. It seems that a "@" phrase after leading dot(s) is causing this behavior. And a simplified sample would be
def f():
    """
    >>> a
    . @1
    .. 2
    ... 3
    .... 4
    """
  1. Wrapping the code as code blocks using ``` doesn't help.

  2. As far as I can tell, the same doc(s) can be rendered correctly up to v2021.1.3, but not since v2021.2.1.

Azureblade3808 avatar Jun 16 '22 02:06 Azureblade3808