Skip to content

Intellisense docstrings do not follow functools.wraps() semantics #2596

Closed
@skilly-lily

Description

@skilly-lily

Environment data

  • VS Code version: 1.27.2 (user setup)
  • Extension version (available under the Extensions sidebar): 2018.8.0
  • OS and version: Windows 10 Enterprise 1803 (64-bit)
  • Python version (& distribution if applicable, e.g. Anaconda): Official CPython 3.7.0
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): replicated with system-level interpreter & pipenv
  • Relevant/affected Python packages and their versions: N/A (problem is with core language and stdlib)

Actual behavior

The function docstrings shown in the intellisense popout (visible on hover) are showing docstrings which do not match those of the interpreter's inspect.getdoc() output.

Expected behavior

The function docstrings shown in the intellisense popout (visible on hover) should match the docstrings shown by the interpreter (output of inspect.getdoc() used as reference), even when there are decorators (sometimes multiple layers) covering them.

Steps to reproduce:

This issue is somewhat reproducible with jedi as the backing language server, but seems more consistent with then new language server.

  1. Hover over the function references on lines 38-39 of the included reproduction script:
    issue.py.txt

  2. Note that the docstrings shown are not the same as the output of inspect.getdoc()

I have included a gif of the reproduction (located at the end of this issue document) to show the kind of output I am getting.

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

Starting Microsoft Python language server.
Initializing for D:\Python37\python.exe

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

None

Gif

issue-replication

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.bugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions